Kaynağa Gözat

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

shizhongqi 11 ay önce
ebeveyn
işleme
5f9e58943d

+ 40 - 0
app-ghs/controllers/BookController.php

@@ -5,6 +5,7 @@ namespace ghs\controllers;
 use bizGhs\book\classes\BookClass;
 use common\components\book;
 use common\components\bookJd;
+use common\components\bookPfHd;
 use common\components\orderSn;
 use common\components\util;
 use Yii;
@@ -125,4 +126,43 @@ class BookController extends BaseController
         }
     }
 
+
+    public function actionLsList()
+    {
+        $list = bookPfHd::$list;
+        util::success(['list' => $list]);
+    }
+
+    //手册详情页 ssh 20211206
+    public function actionLsDetail()
+    {
+        $id = Yii::$app->request->get('id');
+        $data = bookPfHd::$data;
+
+        $bookTitleList = bookPfHd::$list;
+
+        //取出title
+        $titleData = [];
+        foreach ($bookTitleList as $bookList) {
+            foreach ($bookList['list'] as $item) {
+                $currentId = $item['id'] ?? '';
+                $title = $item['title'] ?? '';
+                $titleData[$currentId] = $title;
+            }
+        }
+        $currentTitle = $titleData[$id] ?? '';
+        $info = $data[$id] ?? [];
+        array_unshift($info, ['style' => 'title', 'value' => $currentTitle]);
+
+        //组合出视频完整链接
+        $apiHost = Yii::$app->params['ghsHost'];
+        foreach ($info as $key => $val) {
+            if (isset($val['style']) && $val['style'] == 'video') {
+                $info[$key]['value'] = $apiHost . '/' . $val['value'];
+            }
+        }
+
+        util::success(['list' => $info]);
+    }
+
 }

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

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

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

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

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

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

+ 76 - 0
common/components/bookPfHd.php

@@ -0,0 +1,76 @@
+<?php
+
+namespace common\components;
+
+class bookPfHd
+{
+
+    public static $list = [
+        ['class' => '开始', 'icon' => '/book/begin.png', 'list' => [
+            ['title' => '花掌柜是什么', 'id' => 'hd_what'],
+            ['title' => '如何注册花掌柜', 'id' => 'hd_register'],
+            ['title' => '使用前的准备工作', 'id' => 'hd_prepare'],
+            ['title' => '添加花束到相册', 'id' => 'hd_add_hs_album'],
+            ['title' => '添加花束到商城', 'id' => 'hd_add_hs_mall'],
+            ['title' => '编辑花束简介', 'id' => 'hd_edit_hs_intro'],
+            ['title' => '售后说明和养护知识', 'id' => 'hd_image_text'],
+            ['title' => '添加修改分类', 'id' => 'hd_category'],
+            ['title' => '花束和分类的排序', 'id' => 'hd_order'],
+            ['title' => '分享相册和商城', 'id' => 'hd_share'],
+            ['title' => '自动计算跑腿费', 'id' => 'hd_auto_calc_send_cost'],
+            ['title' => '一键发跑腿', 'id' => 'hd_one_key_send'],
+            ['title' => '搞充值活动', 'id' => 'hd_recharge'],
+            ['title' => '登记客户生日', 'id' => 'hd_birthday'],
+            ['title' => '收款码', 'id' => 'hd_gathering_code'],
+        ]],
+    ];
+
+    public static $data = [
+        'hd_what' => [
+            ['style' => 'video', 'value' => 'jc/hd_what.mp4'],
+        ],
+        'hd_register' => [
+            ['style' => 'video', 'value' => 'jc/hd_register.mp4'],
+        ],
+        'hd_prepare' => [
+            ['style' => 'video', 'value' => 'jc/hd_prepare.mp4'],
+        ],
+        'hd_add_hs_album' => [
+            ['style' => 'video', 'value' => 'jc/hd_add_hs_album.mp4'],
+        ],
+        'hd_add_hs_mall' => [
+            ['style' => 'video', 'value' => 'jc/hd_add_hs_mall.mp4'],
+        ],
+        'hd_edit_hs_intro' => [
+            ['style' => 'video', 'value' => 'jc/hd_edit_hs_intro.mp4'],
+        ],
+        'hd_image_text' => [
+            ['style' => 'video', 'value' => 'jc/hd_image_text.mp4'],
+        ],
+        'hd_category' => [
+            ['style' => 'video', 'value' => 'jc/hd_category.mp4'],
+        ],
+        'hd_order' => [
+            ['style' => 'video', 'value' => 'jc/hd_order.mp4'],
+        ],
+        'hd_share' => [
+            ['style' => 'video', 'value' => 'jc/hd_share.mp4'],
+        ],
+        'hd_auto_calc_send_cost' => [
+            ['style' => 'video', 'value' => 'jc/hd_auto_calc_send_cost.mp4'],
+        ],
+        'hd_one_key_send' => [
+            ['style' => 'video', 'value' => 'jc/hd_one_key_send.mp4'],
+        ],
+        'hd_recharge' => [
+            ['style' => 'video', 'value' => 'jc/hd_recharge.mp4'],
+        ],
+        'hd_birthday' => [
+            ['style' => 'video', 'value' => 'jc/hd_birthday.mp4'],
+        ],
+        'hd_gathering_code' => [
+            ['style' => 'video', 'value' => 'jc/hd_gathering_code.mp4'],
+        ],
+    ];
+
+}