shish 3 лет назад
Родитель
Сommit
ffa75c2a7f
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      biz-ghs/product/classes/ProductClass.php

+ 5 - 0
biz-ghs/product/classes/ProductClass.php

@@ -237,6 +237,11 @@ class ProductClass extends BaseClass
                 $list[$k]['skPrice'] = bcadd($v['discountPrice'], $currentAddPrice, 2);
             }
             $list[$k]['price'] = $price;
+            $cost = $v['cost'] ?? 0;
+            $profit = bcsub($price, $cost, 2);
+            $mll = bcdiv($profit, $cost, 3);
+            $mll = round($mll, 2);
+            $list[$k]['mll'] = $mll;
         }
         return $list;
     }