shish 4 年之前
父節點
當前提交
f34c3fb531
共有 1 個文件被更改,包括 1 次插入6 次删除
  1. 1 6
      app-ghs/controllers/StatKdController.php

+ 1 - 6
app-ghs/controllers/StatKdController.php

@@ -16,10 +16,7 @@ class StatKdController extends BaseController
     {
         $get = Yii::$app->request->get();
         $where = [];
-        $where['shopId'] = $this->shopId;
-        if (isset($get['shopId']) && !empty($get['shopId'])) {
-            $where['shopId'] = $get['shopId'];
-        }
+        $where['mainId'] = $this->mainId;
         $searchTime = $get['searchTime'] ?? 'today';
         if (!empty($searchTime)) {
             $startTime = $get['startTime'] ?? '';
@@ -28,7 +25,6 @@ class StatKdController extends BaseController
             $where['time'] = ['between', [$period['startTime'], $period['endTime']]];
         }
         $kdList = StatKdClass::getAllByCondition($where, null, '*');
-
         $kd = ['wx' => 0, 'alipay' => 0, 'balance' => 0, 'cash' => 0, 'bank' => 0, 'debt' => 0, 'amount' => 0];
         if (!empty($kdList)) {
             foreach ($kdList as $key => $item) {
@@ -41,7 +37,6 @@ class StatKdController extends BaseController
                 $kd['amount'] = bcadd($kd['amount'], $item['amount']);
             }
         }
-
         $refund = ['wx' => 0, 'alipay' => 0, 'balance' => 0, 'cash' => 0, 'bank' => 0, 'debt' => 0, 'amount' => 0];
         $refundList = StatRefundClass::getAllByCondition($where, null, '*');
         if (!empty($refundList)) {