shish преди 1 година
родител
ревизия
990d461911
променени са 1 файла, в които са добавени 7 реда и са изтрити 0 реда
  1. 7 0
      app-ghs/controllers/ConsoleController.php

+ 7 - 0
app-ghs/controllers/ConsoleController.php

@@ -22,6 +22,13 @@ class ConsoleController extends BaseController
     //总览
     public function actionStat()
     {
+        $where = ['shopId' => $this->shopId, 'debt' => 1]; // 重新赋值
+        $pfDebt = OrderClass::sum($where, 'remainDebtPrice'); // 总欠款
+        $pfDebt = $pfDebt === null ? 0 : $pfDebt;
+        $lsDebt = \bizHd\order\classes\OrderClass::sum(['mainId' => $this->mainId, 'debt' => 1], 'remainDebtPrice');
+        $lsDebt = $lsDebt === null ? 0 : $lsDebt;
+        $totalDebt = bcadd($pfDebt, $lsDebt, 2);
+
         $itemList = ItemClass::getAllByCondition(['mainId' => $this->mainId], null, 'id,stock,cost,virtualStock,delStatus', null, true);
         $totalItemNum = 0;
         $totalCost = 0;