ソースを参照

Merge branch 'mt' of git.huaml.com:zhh/huahuibao into mt

shizhongqi 4 年 前
コミット
e791fb7e30

+ 14 - 0
app-hd/controllers/ShopExtController.php

@@ -16,6 +16,20 @@ class ShopExtController extends BaseController
 
     public $guestAccess = [];
 
+    //美团制作单属性状态更新 ssh 20220710
+    public function actionUpdateMtAlone()
+    {
+        $alone = Yii::$app->request->get('alone', 0);
+        $shopId = $this->shopId;
+        $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
+        if (empty($ext)) {
+            util::fail('没有找到门店');
+        }
+        $ext->mtAlone = $alone;
+        $ext->save();
+        util::complete();
+    }
+
     //取出供应商的小菊颜色 ssh 20210907
     public function actionGetGhsXj()
     {

+ 8 - 12
app-hd/controllers/WorkController.php

@@ -2,6 +2,7 @@
 
 namespace hd\controllers;
 
+use biz\shop\classes\ShopExtClass;
 use bizHd\goods\classes\CategoryClass;
 use bizHd\goods\classes\GoodsClass;
 use bizHd\order\classes\OrderClass;
@@ -54,17 +55,13 @@ class WorkController extends BaseController
         }
         if (isset($get['fromType']) && is_numeric($get['fromType'])) {
             $where['fromType'] = $get['fromType'];
-        }
-        if (isset($get['searchType'])) {
-            if ($get['searchType'] == 0) {
-                util::fail('暂不支持名称搜索');
-            } elseif ($get['searchType'] == 1) {
-                if (!empty($get['name'])) {
-                    if (!is_numeric($get['name'])) {
-                        util::fail('编号必须是数字');
-                    }
-                    $where['sn'] = $get['name'];
-                }
+        } else {
+            $shopId = $this->shopId;
+            $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
+            $mtAlone = $ext->mtAlone ?? 0;
+            $isCashier = $get['isCashier'] ?? 0;
+            if ($mtAlone == 1 && $isCashier == 1) {
+                $where['fromType'] = ['in', [1, 2, 3]];
             }
         }
         if (isset($get['sn']) && !empty($get['sn']) && is_numeric($get['sn'])) {
@@ -73,7 +70,6 @@ class WorkController extends BaseController
         if (isset($get['thirdSn']) && !empty($get['thirdSn']) && is_numeric($get['thirdSn'])) {
             $where['thirdSn'] = $get['thirdSn'];
         }
-
         $list = WorkClass::getWorkList($where);
         $list['today'] = date("Y-m-d");
         util::success($list);

+ 5 - 1
biz-hd/work/classes/WorkClass.php

@@ -314,7 +314,11 @@ class WorkClass extends BaseClass
     //工单列表 ssh 20220606
     public static function getWorkList($where)
     {
-        $data = self::getList('*', $where, 'hasReachTime DESC,reachDate ASC,reachPeriod ASC,addTime DESC');
+        $order = 'addTime DESC';
+        if (isset($where['status']) && $where['status'] == 0) {
+            $order = 'hasReachTime DESC,reachDate ASC,reachPeriod ASC,addTime DESC';
+        }
+        $data = self::getList('*', $where, $order);
         $list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
         if (empty($list)) {
             return $data;