Sfoglia il codice sorgente

客户采购列表

shish 4 anni fa
parent
commit
192b69f9e2

+ 32 - 0
app-ghs/controllers/StatKhCgController.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace ghs\controllers;
+
+use biz\stat\classes\StatKhCgClass;
+use common\components\dateUtil;
+use Yii;
+use common\components\util;
+
+class StatKhCgController extends BaseController
+{
+
+    //客户采购列表 shish 20211017
+    public function actionProfile()
+    {
+        $get = Yii::$app->request->get();
+        $where = [];
+        $where['shopId'] = $this->shopId;
+        if (isset($get['shopId']) && !empty($get['shopId'])) {
+            $where['shopId'] = $get['shopId'];
+        }
+        $selectTime = $get['selectTime'] ?? 'thisMonth';
+        if (!empty($selectTime)) {
+            $startTime = $get['startTime'] ?? '';
+            $endTime = $get['endTime'] ?? '';
+            $period = dateUtil::formatTime($selectTime, $startTime, $endTime, true);
+            $where['time'] = ['between', [$period['startTime'], $period['endTime']]];
+        }
+        $list = StatKhCgClass::getAllByCondition($where, null, '*');
+    }
+
+}

+ 2 - 0
console/controllers/StatKhCgController.php

@@ -40,6 +40,7 @@ class StatKhCgController extends Controller
                         $num = $item['num'] ?? 0;
                         $totalNum = bcadd($totalNum, $num, 2);
                     }
+                    //补充总数量
                     OrderClass::updateById($id, ['itemNum' => $totalNum]);
                 }
 
@@ -84,6 +85,7 @@ class StatKhCgController extends Controller
                         $totalNum = bcadd($totalNum, $num, 2);
                     }
                 }
+                //补充总数量和客户id
                 RefundOrderClass::updateById($id, ['itemNum' => $totalNum, 'customId' => $customId]);
 
                 $date = date('Ymd', strtotime($refund['addTime']));