shish 5 anni fa
parent
commit
2d78945c49
1 ha cambiato i file con 17 aggiunte e 43 eliminazioni
  1. 17 43
      app-ghs/controllers/CustomController.php

+ 17 - 43
app-ghs/controllers/CustomController.php

@@ -112,52 +112,26 @@ class CustomController extends BaseController
     //客户列表 ssh 2021.7.8
     public function actionList()
     {
-        if ($this->shopAdminId == 125903) {
-            $get = Yii::$app->request->get();
-            $type = isset($get['type']) ? $get['type'] : 0;
-            $name = isset($get['name']) ? $get['name'] : '';
-            $where = ['ownShopId' => $this->shopId];
-            //欠款客户
-            if (!empty($type) && $type == 1) {
-                $where['isDebt'] = 1;
-            }
-            if (!empty($name)) {
-                if (stringUtil::isLetter($name)) {
-                    $where['py'] = ['like', $name];
-                } else {
-                    $where['name'] = ['like', $name];
-                }
-            }
-            $list = CustomService::getCustomList($where);
-            $shop = $this->shop;
-            $list['totalUser'] = $shop->totalUser ?? 0;
-            $list['mayGatheringNum'] = $shop->mayGatheringNum ?? 0;
-            util::success($list);
-        } else {
-            unset($_GET['page']);
-            $get = Yii::$app->request->get();
-            $type = isset($get['type']) ? $get['type'] : 0;
-            $name = isset($get['name']) ? $get['name'] : '';
-            $where = ['ownShopId' => $this->shopId];
-            //欠款客户
-            if (!empty($type) && $type == 1) {
-                $where['isDebt'] = 1;
-            }
-            if (!empty($name) && strlen($name) >= 2) {
-                if (stringUtil::isLetter($name)) {
-                    $where['py'] = ['like', $name];
-                } else {
-                    $where['name'] = ['like', $name];
-                }
+        $get = Yii::$app->request->get();
+        $type = isset($get['type']) ? $get['type'] : 0;
+        $name = isset($get['name']) ? $get['name'] : '';
+        $where = ['ownShopId' => $this->shopId];
+        //欠款客户
+        if (!empty($type) && $type == 1) {
+            $where['isDebt'] = 1;
+        }
+        if (!empty($name)) {
+            if (stringUtil::isLetter($name)) {
+                $where['py'] = ['like', $name];
             } else {
-                $where['name'] = 'shishaohua8879';
+                $where['name'] = ['like', $name];
             }
-            $list = CustomService::getCustomList($where);
-            $shop = $this->shop;
-            $list['totalUser'] = $shop->totalUser ?? 0;
-            $list['mayGatheringNum'] = $shop->mayGatheringNum ?? 0;
-            util::success($list);
         }
+        $list = CustomService::getCustomList($where);
+        $shop = $this->shop;
+        $list['totalUser'] = $shop->totalUser ?? 0;
+        $list['mayGatheringNum'] = $shop->mayGatheringNum ?? 0;
+        util::success($list);
     }
 
     //客户详情 ssh 2021.1.8