shish 2 lat temu
rodzic
commit
31cf0d1843
1 zmienionych plików z 3 dodań i 4 usunięć
  1. 3 4
      biz-ghs/stat/classes/StatCgClass.php

+ 3 - 4
biz-ghs/stat/classes/StatCgClass.php

@@ -57,14 +57,13 @@ class StatCgClass extends BaseClass
                         $unitPrice = $val->bigPrice ?? 0;
                         $name = $productInfo[$productId]['name'] ?? '';
                         $py = $productInfo[$productId]['py'] ?? '';
+                        $totalPrice = bcmul($remainNum, $unitPrice, 2);
                         if (isset($arr[$productId])) {
-                            $totalPrice = bcmul($remainNum, $unitPrice, 2);
-                            echo $totalPrice;die;
                             $arr[$productId]['num'] = bcadd($arr[$productId]['num'], $remainNum);
                             $arr[$productId]['amount'] = bcadd($arr[$productId]['amount'], $totalPrice, 2);
                         } else {
-                            $arr[$productId]['num'] = 0;
-                            $arr[$productId]['amount'] = 0;
+                            $arr[$productId]['num'] = $remainNum;
+                            $arr[$productId]['amount'] = $totalPrice;
                             $arr[$productId]['py'] = $py;
                             $arr[$productId]['name'] = $name;
                         }