shish 4 лет назад
Родитель
Сommit
fecc3298c3
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      app-ghs/controllers/StatController.php

+ 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');