shish 4 жил өмнө
parent
commit
fecc3298c3

+ 2 - 1
app-ghs/controllers/StatController.php

@@ -58,7 +58,8 @@ class StatController extends BaseController
                 $stat[$productId]['num'] = bcadd($stat[$productId]['num'], $num, 2);
                 $stat[$productId]['amount'] = bcadd($stat[$productId]['amount'], $cost, 2);
                 $totalNum = bcadd($totalNum, $num, 2);
-                $totalCost = bcadd($totalCost, $cost, 2);
+                $currentCost = bcmul($cost, $num, 2);
+                $totalCost = bcadd($totalCost, $currentCost, 2);
             }
             $stat = array_values($stat);
             $stat = arrayUtil::arraySort($stat, 'num');