shizhongqi 4 lat temu
rodzic
commit
c4bc4f2c99
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 3
      app-ghs/controllers/ConsoleController.php

+ 2 - 3
app-ghs/controllers/ConsoleController.php

@@ -26,13 +26,12 @@ class ConsoleController extends BaseController
         $todayActIncome = OrderClass::sum($where, 'actPrice'); // 今日实收
         $todayActIncome = $todayActIncome === null ? 0 : $todayActIncome;
 
-        $where = ['debt' => 1];
+        $where = ['shopId' => $this->shopId, 'debt' => 1]; // 重新赋值
         $where['addTime'] = ['between', [$todayStartTime, $todayEndTime]];
         $todayDebt = OrderClass::sum($where, 'debtPrice'); // 今日欠款
         $todayDebt = $todayDebt === null ? 0 : $todayDebt;
 
-        $where = ['debt' => 1];
-        unset($where['addTime']);
+        $where = ['shopId' => $this->shopId, 'debt' => 1]; // 重新赋值
         $totalDebt = OrderClass::sum($where, 'debtPrice'); // 总欠款
         $totalDebt = $totalDebt === null ? 0 : $totalDebt;