Просмотр исходного кода

Merge branch 'master' into dev

shish 11 месяцев назад
Родитель
Сommit
626ff5199f

+ 36 - 5
app-ghs/controllers/CustomController.php

@@ -14,6 +14,7 @@ use bizGhs\order\classes\OrderClass;
 use bizHd\saas\classes\ApplyClass;
 use bizHd\saas\classes\ApplyClass;
 use bizHd\saas\services\ApplyService;
 use bizHd\saas\services\ApplyService;
 use bizHd\shop\classes\ShopClass;
 use bizHd\shop\classes\ShopClass;
+
 //use bizHd\stat\classes\StatVisitClass;
 //use bizHd\stat\classes\StatVisitClass;
 use bizGhs\stat\classes\StatVisitClass;
 use bizGhs\stat\classes\StatVisitClass;
 use common\components\dict;
 use common\components\dict;
@@ -665,8 +666,8 @@ class CustomController extends BaseController
         }
         }
 
 
         $get = Yii::$app->request->get();
         $get = Yii::$app->request->get();
-        $type = isset($get['type']) ? $get['type'] : 0;
-        $name = isset($get['name']) ? $get['name'] : '';
+        $type = $get['type'] ?? 0;
+        $name = $get['name'] ?? '';
         $export = $get['export'] ?? 0;
         $export = $get['export'] ?? 0;
         $mainId = $this->mainId;
         $mainId = $this->mainId;
         $isCashier = $get['isCashier'] ?? 0;
         $isCashier = $get['isCashier'] ?? 0;
@@ -678,6 +679,7 @@ class CustomController extends BaseController
 
 
         $where = ['ownMainId' => $this->mainId];
         $where = ['ownMainId' => $this->mainId];
         $sort = 'visitTime DESC';
         $sort = 'visitTime DESC';
+        $where['delStatus'] = 0;
         if ($type == 1) {
         if ($type == 1) {
             //消费排行
             //消费排行
             $sort = 'buyAmount DESC';
             $sort = 'buyAmount DESC';
@@ -686,15 +688,25 @@ class CustomController extends BaseController
             $where['isDebt'] = 1;
             $where['isDebt'] = 1;
             $sort = '(debtAmount-balance) DESC';
             $sort = '(debtAmount-balance) DESC';
         } else if ($type == 3) {
         } else if ($type == 3) {
-            $where['level'] = 0;
+            //大客户
+            $where['level'] = 2;
         } else if ($type == 4) {
         } else if ($type == 4) {
-            //最近未下单
+            //零售客户
+            $where['level'] = 0;
+        } else if ($type == 5) {
+            //休眠客户
             $recentDay = isset($get['recentDay']) && is_numeric($get['recentDay']) ? (int)$get['recentDay'] : 7;
             $recentDay = isset($get['recentDay']) && is_numeric($get['recentDay']) ? (int)$get['recentDay'] : 7;
             $totalSecond = bcmul(86400, $recentDay);
             $totalSecond = bcmul(86400, $recentDay);
             $currentSecond = bcsub(time(), $totalSecond);
             $currentSecond = bcsub(time(), $totalSecond);
             $currentDate = date("Y-m-d H:i:s", $currentSecond);
             $currentDate = date("Y-m-d H:i:s", $currentSecond);
             $where['recentExpend<'] = $currentDate;
             $where['recentExpend<'] = $currentDate;
             $sort = 'recentExpend desc';
             $sort = 'recentExpend desc';
+        } else if ($type == 6) {
+            //黑名单
+            $where['black'] = 2;
+        } else if ($type == 7) {
+            //已删除
+            $where['delStatus'] = 1;
         }
         }
         $name = trim($name);
         $name = trim($name);
         if (!empty($name)) {
         if (!empty($name)) {
@@ -1047,7 +1059,7 @@ class CustomController extends BaseController
     public function actionShowTotalBalance()
     public function actionShowTotalBalance()
     {
     {
         $lookMoney = \bizGhs\shop\classes\ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
         $lookMoney = \bizGhs\shop\classes\ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
-        if($lookMoney == 0){
+        if ($lookMoney == 0) {
             util::fail('无法查看哦');
             util::fail('无法查看哦');
         }
         }
 
 
@@ -1060,4 +1072,23 @@ class CustomController extends BaseController
         util::success($respond);
         util::success($respond);
     }
     }
 
 
+    public function actionChangeDelStatus()
+    {
+        $get = Yii::$app->request->get();
+        $customId = $get['id'] ?? 0;
+        $delStatus = $get['delStatus'] ?? 0;
+        $custom = CustomClass::getById($customId, true);
+        CustomClass::valid($custom, $this->shopId);
+        $ghsId = $custom->ghsId ?? 0;
+        $ghs = GhsClass::getById($ghsId, true);
+        if (empty($ghs)) {
+            util::fail('客户信息有缺失');
+        }
+        $custom->delStatus = $delStatus;
+        $custom->save();
+        $ghs->delStatus = $delStatus;
+        $ghs->save();
+        util::complete('删除成功');
+    }
+
 }
 }

+ 1 - 1
app-ghs/controllers/TestController.php

@@ -398,7 +398,7 @@ class TestController extends BaseController
             //['name' => '济南伟伟鲜花批发', 'merchantNo' => '8224510599200EL', 'wx' => [789073494, 789074603], 'zfb' => '2088670850497224'],
             //['name' => '济南伟伟鲜花批发', 'merchantNo' => '8224510599200EL', 'wx' => [789073494, 789074603], 'zfb' => '2088670850497224'],
             //['name' => '赣州紫荆鲜花批发', 'merchantNo' => '82242805992004J', 'wx' => [790052021, 790051859], 'zfb' => '2088670969143838'],
             //['name' => '赣州紫荆鲜花批发', 'merchantNo' => '82242805992004J', 'wx' => [790052021, 790051859], 'zfb' => '2088670969143838'],
             //['name' => '莆田鲜花闪送', 'merchantNo' => '82239405992005W', 'wx' => [808858266, 808858114], 'zfb' => '2088970298325670'],
             //['name' => '莆田鲜花闪送', 'merchantNo' => '82239405992005W', 'wx' => [808858266, 808858114], 'zfb' => '2088970298325670'],
-            ['name' => '水头十里鲜花批发', 'merchantNo' => '8223970599200DX', 'wx' => [812680599, 812680180], 'zfb' => '2088970615112103'],
+            ['name' => '水头十里花田鲜花批发', 'merchantNo' => '8223970599200DX', 'wx' => [812680599, 812680180], 'zfb' => '2088970615112103'],
             ['name' => '泉州沙丘鲜花批发', 'merchantNo' => '8223970599200DV', 'wx' => [812653846, 812652998], 'zfb' => '2088970612345533'],
             ['name' => '泉州沙丘鲜花批发', 'merchantNo' => '8223970599200DV', 'wx' => [812653846, 812652998], 'zfb' => '2088970612345533'],
             //['name' => '昆明小向鲜花', 'merchantNo' => '8227310599200UX', 'wx' => [811911098, 811911180], 'zfb' => '2088970555233957'],
             //['name' => '昆明小向鲜花', 'merchantNo' => '8227310599200UX', 'wx' => [811911098, 811911180], 'zfb' => '2088970555233957'],
             //['name' => '惠安花优美', 'merchantNo' => '8223970599200DP', 'wx' => [811651765, 811651866], 'zfb' => '2088970528927690'],
             //['name' => '惠安花优美', 'merchantNo' => '8223970599200DP', 'wx' => [811651765, 811651866], 'zfb' => '2088970528927690'],

+ 7 - 0
biz-hd/shop/classes/ShopClass.php

@@ -99,6 +99,13 @@ class ShopClass extends BaseClass
                 $list[$key]['img'] = [];
                 $list[$key]['img'] = [];
                 $list[$key]['imgUrl'] = [];
                 $list[$key]['imgUrl'] = [];
             }
             }
+
+            $avatar = $val['avatar'] ?? '';
+            $shortAvatar = $val['shortAvatar'] ?? '';
+            $smallAvatar = imgUtil::groupImg($img) . "?x-oss-process=image/resize,m_fill,h_130,w_130";
+            $list[$key]['smallAvatar'] = $smallAvatar;
+            $list[$key]['shortAvatar'] = $shortAvatar;
+
             $superWx = $val['superWx'] ?? '';
             $superWx = $val['superWx'] ?? '';
             $shortSuperWx = $superWx;
             $shortSuperWx = $superWx;
             $list[$key]['shortSuperWx'] = $shortSuperWx;
             $list[$key]['shortSuperWx'] = $shortSuperWx;