Răsfoiți Sursa

客户区分

shish 5 ani în urmă
părinte
comite
397a539f41
1 a modificat fișierele cu 43 adăugiri și 20 ștergeri
  1. 43 20
      app-ghs/controllers/CustomController.php

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

@@ -112,29 +112,52 @@ class CustomController extends BaseController
     //客户列表 ssh 2021.7.8
     public function actionList()
     {
-        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];
+        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];
+                }
             } else {
-                $where['name'] = ['like', $name];
+                $where['name'] = 'shishaohua8879';
             }
-        }else{
-            $where['name'] = 'shishaohua8879';
+            $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