shish před 2 roky
rodič
revize
a3b356ee1b
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      app-ghs/controllers/PurchaseOrderController.php

+ 3 - 1
app-ghs/controllers/PurchaseOrderController.php

@@ -579,6 +579,7 @@ class PurchaseOrderController extends BaseController
         $cgWhere['entryTime'] = ['between', [$currentStartTime, $currentEndTime]];
         $cgList = PurchaseOrderClass::getAllByCondition($cgWhere, null, '*');
         $list = [];
+        $totalAmount = 0;
         if (!empty($cgList)) {
             foreach ($cgList as $cgInfo) {
                 $actPrice = $cgInfo['actPrice'] ?? 0;
@@ -590,10 +591,11 @@ class PurchaseOrderController extends BaseController
                     $name = $ghsList[$ghsId] && $ghsList[$ghsId]['name'] ? $ghsList[$ghsId]['name'] : '未命名';
                     $list[$ghsId] = ['id' => $ghsId, 'name' => $name, 'amount' => $actPrice, 'num' => 1];
                 }
+                $totalAmount = bcadd($totalAmount, $actPrice, 2);
             }
             $list = array_values($list);
         }
-        util::success(['list' => $list]);
+        util::success(['list' => $list, 'totalAmount' => $totalAmount]);
     }
 
 }