Sfoglia il codice sorgente

Merge branch 'master' into zhongqi-delivery

shish 7 mesi fa
parent
commit
e86426bbfe

+ 1 - 0
app-ghs/controllers/AuthController.php

@@ -567,6 +567,7 @@ class AuthController extends PublicController
             'staff' => $shopAdmin,
             'lookAllShop' => $lookAllShop,
             'labelList' => $labelList,
+            'currentMiniOpenId' => $openid
         ]);
     }
 

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

@@ -168,7 +168,7 @@ class ConsoleController extends BaseController
             }
         }
 
-        //$notice[] = ['title' => '早上有急事请连打二次小石电话', 'action' => '', 'page' => ''];
+        //$notice[] = ['title' => '赊账最近会统一更名为挂账', 'action' => '', 'page' => ''];
         //$notice[] = ['title' => '新功能:客户端和后台使用跑腿的流程', 'action' => '', 'page' => '/admin/book/detail?id=use_pt'];
         //$notice[] = ['title' => '快速设置:客户下单自动计算跑腿费', 'action' => '查看', 'page' => '/admin/book/detail?id=auto_calc_pt_fee'];
         //$notice[] = ['title' => '订单上如何一键呼叫跑腿', 'action' => '查看', 'page' => '/admin/book/detail?id=one_call_pt'];

+ 3 - 10
app-ghs/controllers/CustomController.php

@@ -147,7 +147,7 @@ class CustomController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉
             if (in_array($this->shopId, [23580, 24713])) {
-                if (!in_array($this->adminId, [24043, 23960, 4, 77951])) {
+                if (!in_array($this->adminId, [23960,77951,4])) {
                     util::fail('不能销单哦!!');
                 }
             }
@@ -1133,14 +1133,14 @@ class CustomController extends BaseController
     public function actionChangeLevel()
     {
         $shopAdmin = $this->shopAdmin;
-        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+        if (!isset($shopAdmin->super) || $shopAdmin->super != 1) {
             util::fail('超管才能修改');
         }
 
         //泉城的只有苏小娟才能修改
         if (getenv('YII_ENV') == 'production') {
             if ($this->mainId == 60) {
-                if (in_array($this->adminId, [2499, 4]) == false) {
+                if (!in_array($this->adminId, [2499, 4])) {
                     util::fail('请小娟修改');
                 }
             }
@@ -1217,15 +1217,8 @@ class CustomController extends BaseController
         $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/OrderClearController.php

@@ -151,7 +151,7 @@ class OrderClearController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉
             if (in_array($this->shopId, [23580, 24713])) {
-                if (!in_array($this->adminId, [24043, 23960,77951])) {
+                if (!in_array($this->adminId, [23960,77951,4])) {
                     util::fail('不能销单哈!');
                 }
             }

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

@@ -1088,7 +1088,7 @@ class OrderController extends BaseController
         }
 
         if (getenv('YII_ENV') == 'production') {
-            //小向花卉开单售后控制
+            //小向花卉开单权限
             if ($this->mainId == 23390) {
                 if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960, 28456, 31105, 28456, 31105, 52528, 25011, 61449, 77951, 24655])) {
                     util::fail('你不能开单哦');

+ 8 - 3
app-ghs/controllers/ProductController.php

@@ -177,8 +177,15 @@ class ProductController extends BaseController
         if (empty($info)) {
             util::fail('没有找到花材');
         }
-        $price = $info->skPrice ?? 0;
+
+        $priceMap = CustomClass::$levelPriceKeyMap;
+        $addPriceMap = CustomClass::$levelAddPriceKeyMap;
+
+        $price = ProductClass::getFinalPrice($info, 0, $priceMap, $addPriceMap);
         $price = floatval($price);
+        $hyPrice = ProductClass::getFinalPrice($info, 1, $priceMap, $addPriceMap);
+        $hyPrice = floatval($hyPrice);
+
         $name = $info->name ?? '';
         $ptItemId = $info->itemId ?? 0;
         $mainId = $info->mainId ?? 0;
@@ -223,8 +230,6 @@ class ProductController extends BaseController
             }
             if (in_array($this->mainId, $doublePrice)) {
                 //惠雅鲜花,打价格,显示正价和会员价,多处同步修改,关键词 hy_print_label_price ssh 20260101
-                $hyPrice = $info->price ?? 0;
-                $hyPrice = floatval($hyPrice);
                 $content .= '<TEXT x="35" y="90" font="12" w="2" h="2" r="0">----------</TEXT>';
                 $content .= '<TEXT x="35" y="150" font="12" w="2" h="2" r="0">正价 ' . $price . '元</TEXT>';
                 $content .= '<TEXT x="35" y="230" font="12" w="2" h="2" r="0">会员价 ' . $hyPrice . '元</TEXT>';

+ 18 - 9
app-ghs/controllers/PurchaseOrderController.php

@@ -5,6 +5,7 @@ namespace ghs\controllers;
 use biz\ghs\classes\GhsClass;
 use biz\sj\classes\SjClass;
 use bizGhs\book\classes\BookItemClass;
+use bizGhs\custom\classes\CustomClass;
 use bizGhs\order\classes\PurchaseOrderClass;
 use bizGhs\order\classes\PurchaseOrderItemClass;
 use bizGhs\product\classes\ProductClass;
@@ -203,6 +204,9 @@ class PurchaseOrderController extends BaseController
         $ids = array_unique($ids);
         $infoList = ProductClass::getAllByCondition(['id' => ['in', $ids]], null, '*', 'id');
 
+        $priceMap = CustomClass::$levelPriceKeyMap;
+        $addPriceMap = CustomClass::$levelAddPriceKeyMap;
+
         foreach ($itemList as $key => $item) {
             $name = $item->name ?? '';
             $num = !empty($item->itemNum) ? floatval($item->itemNum) : 0;
@@ -220,8 +224,15 @@ class PurchaseOrderController extends BaseController
                 $unit = '若干' . $smallUnit . '装';
             }
 
-            $price = $infoList[$productId] && $infoList[$productId]['skPrice'] ? $infoList[$productId]['skPrice'] : 0;
-            $price = floatval($price);
+            $price = 0;
+            $hyPrice = 0;
+            if (isset($infoList[$productId])) {
+                $currentInfo = $infoList[$productId];
+                $price = ProductClass::getFinalPrice($currentInfo, 0, $priceMap, $addPriceMap);
+                $price = floatval($price);
+                $hyPrice = ProductClass::getFinalPrice($currentInfo, 1, $priceMap, $addPriceMap);
+                $hyPrice = floatval($hyPrice);
+            }
 
             if (stringUtil::getWordNum($name) > 8) {
                 $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
@@ -240,9 +251,9 @@ class PurchaseOrderController extends BaseController
                 } elseif ($mainId == 72057) {
                     $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
                 } else {
-                    if($priceOption == 0){
+                    if ($priceOption == 0) {
                         $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
-                    }else{
+                    } else {
                         $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . ' ' . $price . '元</TEXT>';
                     }
                 }
@@ -254,12 +265,10 @@ class PurchaseOrderController extends BaseController
                 }
                 if (in_array($this->mainId, $doublePrice)) {
                     //惠雅鲜花,打价格,显示正价和会员价,多处同步修改,关键词 hy_print_label_price ssh 20260101
-                    $hyPrice = $infoList[$productId] && $infoList[$productId]['price'] ? $infoList[$productId]['price'] : 0;
-                    $hyPrice = floatval($hyPrice);
                     $content .= '<TEXT x="35" y="90" font="12" w="2" h="2" r="0">----------</TEXT>';
                     $content .= '<TEXT x="35" y="150" font="12" w="2" h="2" r="0">正价 ' . $price . '元</TEXT>';
                     $content .= '<TEXT x="35" y="230" font="12" w="2" h="2" r="0">会员价 ' . $hyPrice . '元</TEXT>';
-                }elseif ($this->mainId == 4556) {
+                } elseif ($this->mainId == 4556) {
                     //打价格,显示零售价,并且不带元,杭州斗南鲜花不要带元
                     $content .= '<TEXT x="35" y="150" font="12" w="4" h="4" r="0">' . $price . '</TEXT>';
                 } else {
@@ -556,12 +565,12 @@ class PurchaseOrderController extends BaseController
                 //城市批发店限制不能让其录小单位,太多人录错,昆明批发不知道有没人录,暂时不限制。 ssh 20250308
                 if ($shop->pfLevel == 0) {
                     if ($smallNum > 0) {
-                        util::fail('不能录小单位:' . $name);
+                        //util::fail('不能录小单位:' . $name);
                     }
                 }
 
                 if ($globalCgMyCharge == 1) {
-                    if (isset($needCgList[$productId]) == false) {
+                    if (!isset($needCgList[$productId])) {
                         util::fail($name . ' 不需要采购');
                     }
                     $needNum = $needCgList[$productId];

+ 6 - 6
app-ghs/controllers/RefundController.php

@@ -134,9 +134,9 @@ class RefundController extends BaseController
 
         //多处要同步修改ghs_refund ssh 20250331
         if (getenv('YII_ENV') == 'production') {
-            //小向花卉开单售后控制
+            //小向花卉售后权限
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960,77951])) {
+                if (!in_array($this->adminId, [23960,77951,4])) {
                     util::fail('你不能售后哦');
                 }
                 //小向花卉售后必须备注
@@ -228,9 +228,9 @@ class RefundController extends BaseController
 
         //多处要同步修改ghs_refund ssh 20250331
         if (getenv('YII_ENV') == 'production') {
-            //小向花卉开单售后控制
+            //小向花卉售后权限
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960,77951])) {
+                if (!in_array($this->adminId, [23960,77951,4])) {
                     util::fail('你不能售后哦。。');
                 }
                 //小向花卉售后必须备注
@@ -614,9 +614,9 @@ class RefundController extends BaseController
 
         //多处要同步修改ghs_refund ssh 20250331
         if (getenv('YII_ENV') == 'production') {
-            //小向花卉开单售后控制
+            //小向花卉售后权限
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960,77951])) {
+                if (!in_array($this->adminId, [23960,77951,4])) {
                     util::fail('你不能售后哈。。');
                 }
                 //小向花卉售后必须备注

+ 7 - 1
app-ghs/controllers/RenewController.php

@@ -151,7 +151,13 @@ class RenewController extends BaseController
         $totalFee = $price;
 
         $admin = $this->admin;
-        $openId = $admin->ghsMiniOpenId;
+        $openId = $get['currentMiniOpenId'] ?? '';
+        if (empty($openId)) {
+            $openId = $admin->ghsMiniOpenId;
+        }
+        if (empty($openId)) {
+            util::fail('账号有问题,无法支付');
+        }
         $capitalType = dict::getDict('capitalType', 'xhRenew', 'id');
         $attach = 'capitalType=' . $capitalType;
         $wx = Yii::getAlias("@vendor/weixin");

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

@@ -352,7 +352,7 @@ class ShopAdminController extends BaseController
         $id = Yii::$app->request->get('id');
 
         $shopAdmin = $this->shopAdmin;
-        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+        if (!isset($shopAdmin->super) || $shopAdmin->super != 1) {
             util::fail('没有权限');
         }
 

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

@@ -455,7 +455,8 @@ class TestController extends BaseController
             //['name' => '宝鸡美婷鲜花批发', 'merchantNo' => '82279305992004N', 'wx' => [847681058, 847680856], 'zfb' => '2088180872582801'],
             //['name' => '广州翰林花卉', 'merchantNo' => '8225810599201LR', 'wx' => [850644821, 850644094], 'zfb' => '2088280085826650'],
             //['name' => '昆明宅小鲜', 'merchantNo' => '8223910599200PL', 'wx' => [852957278, 852958031], 'zfb' => '2088280271476229'],
-            ['name' => '昆明小向花卉批发', 'merchantNo' => '8227310599200Z2', 'wx' => [857900016, 857899180], 'zfb' => '2088280559651366'],
+            //['name' => '昆明小向花卉批发', 'merchantNo' => '8227310599200Z2', 'wx' => [857900016, 857899180], 'zfb' => '2088280559651366'],
+            ['name' => '昆明小玖花卉批发', 'merchantNo' => '8227310599200Z3', 'wx' => [858815386, 858815193], 'zfb' => '2088280613495934'],
             //['name' => '厦门都市鲜花批发', 'merchantNo' => '8223930599200HZ', 'wx' => [854245016, 854244735], 'zfb' => '2088280333454097'],
             //['name' => '深圳鼎盛皇室花卉', 'merchantNo' => '8225840599201MF', 'wx' => [807078304, 807076486], 'zfb' => '2088970117746334'],
             //['name' => '东莞惠雅鲜花(莞城店)', 'merchantNo' => '8226020599200GJ', 'wx' => [796953190, 796976959], 'zfb' => '2088770940104912'],

+ 1 - 1
app-hd/controllers/AdminController.php

@@ -75,7 +75,7 @@ class AdminController extends BaseController
         $transaction = $connection->beginTransaction();
 
         try {
-            // 执行离职操作
+            // 执行离职操作,多处使用,关键词 staff_lz
             $respond = StaffClass::executeStaffResignation($admin, $staff);
             $transaction->commit();
             util::success($respond);

+ 0 - 4
app-hd/controllers/GhsController.php

@@ -142,10 +142,6 @@ class GhsController extends BaseController
         }
         $ghs->delStatus = $delStatus;
         $ghs->save();
-        $customId = $ghs->customId ?? 0;
-        $custom = CustomClass::getById($customId, true);
-        $custom->delStatus = $delStatus;
-        $custom->save();
         util::complete('操作成功');
     }
 

+ 1 - 1
app-hd/controllers/ProductController.php

@@ -704,7 +704,7 @@ class ProductController extends BaseController
             $where['frontHide'] = 0;
 
             $level = $ghs['giveLevel'] ?? 1;
-            $field = 'id,py,cover,name,ratio,classId,itemId,weight,smallUnit,bigUnit,smallUnit,smallRatio,ratioType,variety,price,skPrice,skDiscountPrice,hjPrice,hjDiscountPrice,actualSold,stock,stockWarning,discountPrice,presell,presellDate,reachNum,reachNumDiscount,limitBuy';
+            $field = 'id,py,cover,name,ratio,classId,itemId,weight,smallUnit,bigUnit,smallUnit,smallRatio,ratioType,variety,price,skPrice,skDiscountPrice,hjPrice,hjDiscountPrice,avCost,actualSold,stock,stockWarning,discountPrice,presell,presellDate,reachNum,reachNumDiscount,limitBuy';
             $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
             $itemInfoData = ProductClass::hdCgGroup($itemInfoData, $level, $ghs);
             $myProduct = ProductClass::getAllByCondition(['mainId' => $this->mainId, 'delStatus' => 0], null, 'id,stock,onStock,stockWarning,itemId', 'itemId');

+ 4 - 4
app-pt/views/main/app.php

@@ -236,10 +236,10 @@
             }
             // 这里可以根据appType跳转到对应的下载链接
             const downloadUrls = {
-                'xiaohuabao': 'https://api.shop.hzghd.com/1274.apk', // 销花宝APP下载链接
-                'huazhanggui': 'https://api.shop.hzghd.com/226.apk', // 花掌柜APP下载链接
-                'huazhanggui_cashier': 'https://api.shop.hzghd.com/195.apk', // 花掌柜收银下载链接
-                'xiaohuabao_cashier': 'https://api.shop.hzghd.com/152.apk' // 销花宝收银下载链接
+                'xiaohuabao': 'https://api.shop.hzghd.com/1277.apk', // 销花宝APP下载链接
+                'huazhanggui': 'https://api.shop.hzghd.com/229.apk', // 花掌柜APP下载链接
+                'huazhanggui_cashier': 'https://api.shop.hzghd.com/196.apk', // 花掌柜收银下载链接
+                'xiaohuabao_cashier': 'https://api.shop.hzghd.com/154.apk' // 销花宝收银下载链接
             };
             const url = downloadUrls[appType];
             if (url && url !== '#') {

+ 8 - 3
biz-ghs/order/classes/OrderClass.php

@@ -1931,7 +1931,7 @@ class OrderClass extends BaseClass
         if ($payDate != $sendTimWant) {
             $content .= '<BR><BR>';
             $content .= '********************************<BR>';
-            $content .= '<CB>送货时间</CB><BR>';
+            $content .= '<CB>注意! 送货时间</CB><BR>';
             $content .= '<CB><BOLD>【' . $orderInfo['sendTimeWant'] . '】</BOLD></CB>';
             $content .= '********************************<BR><BR><BR>';
         }
@@ -2962,6 +2962,11 @@ XL;
         $remark = $order->remark ?? '';
         $shortRemark = stringUtil::subStringUtf8($remark, 8);
 
+        $wlName = $custom->wlName ?? '';
+        if(empty($wlName)){
+            $wlName = $shortRemark;
+        }
+
         $address = $order->address ?? '';
         $floor = $order->floor ?? '';
         $fullAddress = $address . $floor;
@@ -2989,8 +2994,8 @@ XL;
             $content = '<TEXT x="420" y="130" font="12" w="4" h="4" r="90">' . $shortName . '</TEXT>';
             $content .= '<TEXT x="395" y="10" font="12" w="2" h="2" r="90">地址</TEXT>';
             $content .= '<TEXT x="290" y="130" font="12" w="3" h="3" r="90">' . $customMobile . '</TEXT>';
-            $content .= '<TEXT x="265" y="10" font="12" w="2" h="2" r="90">码</TEXT>';
-            $content .= '<TEXT x="170" y="130" font="12" w="4" h="4" r="90">' . $shortRemark . '</TEXT>';
+            $content .= '<TEXT x="265" y="10" font="12" w="2" h="2" r="90">码</TEXT>';
+            $content .= '<TEXT x="170" y="130" font="12" w="4" h="4" r="90">' . $wlName . '</TEXT>';
             $content .= '<TEXT x="150" y="10" font="12" w="2" h="2" r="90">物流</TEXT>';
             $content .= '<TEXT x="45" y="70" font="12" w="2" h="2" r="90">' . $currentName . ' ' . $telephone . '</TEXT>';
         } else {

+ 21 - 10
biz-ghs/product/classes/ProductClass.php

@@ -696,17 +696,18 @@ class ProductClass extends BaseClass
             $list[$k]['bigNum'] = $stockInfo['bigNum'];
             $list[$k]['smallNum'] = $stockInfo['smallNum'];
             $list[$k]['itemName'] = $v['name'] ?? '';
-            //小一级的价格
-            if ($level > 0) {
-                $littleLevel = bcsub($level, 1);
-            } else {
-                $littleLevel = $level;
+
+            //今日特价、会员价
+            $price = self::getFinalPrice($v, $level, $priceMap, $addPriceMap);
+            $defaultGradePrice = 0;
+            if ($level == 2) {
+                //如果是大客户,取出更低一级的客户价格,用于前端对比展示:显示原价和会员价
+                $littleLevel = 1;
+                $defaultGradePrice = self::getFinalPrice($v, $littleLevel, $priceMap, $addPriceMap);
             }
-            $defaultGradePrice = self::getFinalPrice($v, $littleLevel, $priceMap, $addPriceMap);
             $list[$k]['defaultGradePrice'] = $defaultGradePrice;
             $list[$k]['myLevel'] = $level;
-            //今日特价、会员价
-            $price = self::getFinalPrice($v, $level, $priceMap, $addPriceMap);
+
             $reachPrice = 0;
             //满10扎多少钱
             if (isset($v['reachNum']) && $v['reachNum'] > 0) {
@@ -754,8 +755,18 @@ class ProductClass extends BaseClass
         if (empty($product) || isset($product['price']) == false) {
             return 0;
         }
-        $currentPriceField = $priceMap[$level] ?? 'price';
-        $price = $product[$currentPriceField] ?? 0;
+        if ($level == 9) {
+            $avCost = $product['avCost'] ?? 0;
+            $price = $avCost;
+            if ($price <= 0) {
+                $cost = $product['cost'] ?? 0;
+                $price = $cost;
+            }
+        } else {
+            $currentPriceField = $priceMap[$level] ?? 'price';
+            $price = $product[$currentPriceField] ?? 0;
+        }
+
         $discountPrice = $product['discountPrice'] ?? 0;
         $hjDiscountPrice = $product['hjDiscountPrice'] ?? 0;
         $skDiscountPrice = $product['skDiscountPrice'] ?? 0;

+ 32 - 3
biz-hd/custom/classes/CustomClass.php

@@ -714,8 +714,23 @@ class CustomClass extends BaseClass
                 $data['birthdayDate'] = $birthdayDate;
                 $data['lunar'] = $lunar;
             }
-            $custom = self::addCustom($data);
-            $isNewCustom = 1;
+            // 处理并发插入:尝试插入,如果遇到唯一键冲突则重新查询
+            try {
+                $custom = self::addCustom($data);
+                $isNewCustom = 1;
+            } catch (\yii\db\IntegrityException $e) {
+                // 唯一键冲突,说明其他并发请求已经插入,重新查询
+                if (strpos($e->getMessage(), 'Duplicate entry') !== false) {
+                    $custom = self::getByCondition(['shopId' => $shopId, 'userId' => $userId], true);
+                    if (empty($custom)) {
+                        // 如果仍然查不到,则抛出异常
+                        throw $e;
+                    }
+                    $isNewCustom = 0;
+                } else {
+                    throw $e;
+                }
+            }
         }
         $customId = $custom->id ?? 0;
         $hd = HdClass::getByCondition(['shopId' => $shopId, 'userId' => $userId], true);
@@ -740,7 +755,21 @@ class CustomClass extends BaseClass
                 'long' => $shop->long ?? '',
                 'salt' => $salt,
             ];
-            $hd = HdClass::addData($hdData);
+            // 处理并发插入:尝试插入,如果遇到唯一键冲突则重新查询
+            try {
+                $hd = HdClass::addData($hdData);
+            } catch (\yii\db\IntegrityException $e) {
+                // 唯一键冲突,说明其他并发请求已经插入,重新查询
+                if (strpos($e->getMessage(), 'Duplicate entry') !== false) {
+                    $hd = HdClass::getByCondition(['shopId' => $shopId, 'userId' => $userId], true);
+                    if (empty($hd)) {
+                        // 如果仍然查不到,则抛出异常
+                        throw $e;
+                    }
+                } else {
+                    throw $e;
+                }
+            }
             $isNewCustom = 1;
         }
         $hdId = $hd->id ?? 0;

+ 4 - 16
biz-hd/staff/classes/StaffClass.php

@@ -21,36 +21,24 @@ class StaffClass extends BaseClass
     {
         $id = $relation->id ?? 0;
         if ($relation->founder == 2) {
-            util::fail("超管不能删除");
+            util::fail("不能删老板");
         }
         if ($id == $thisShopAdminId) {
             util::fail("不能删自己");
         }
         self::valid($relation, $mainId);
         $adminId = $relation->adminId ?? 0;
-        $currentShopId = $relation->shopId ?? 0;
         $admin = AdminClass::getById($adminId, true);
         if (empty($admin)) {
             util::fail('没有找到员工信息');
         }
-        $admin->currentShopId = 0;
-        $admin->save();
-        $relation->delStatus = 1;
-        $relation->save();
-        //删除员工关系后,再找出这个员工还有没其它门店员工身份补上
-        if (!empty($admin) && isset($admin->currentShopId) && $admin->currentShopId == $currentShopId) {
-            $has = self::getByCondition(['adminId' => $adminId, 'delStatus' => 0, 'status' => 1], true);
-            $hasCurrentShopId = $has->shopId ?? 0;
-            $admin->currentShopId = $hasCurrentShopId;
-            $admin->save();
-        }
-        // 员工数-1
-        AdminRoleClass::counters(['num' => -1], ['id' => $relation->roleId]);
+        //员工离职,多处使用,关键词 staff_lz
+        StaffClass::executeStaffResignation($admin, $relation);
     }
 
     public static function valid($relation, $mainId)
     {
-        if (isset($relation->mainId) == false || $relation->mainId != $mainId) {
+        if (!isset($relation->mainId) || $relation->mainId != $mainId) {
             util::fail('没有权限');
         }
     }

+ 1 - 4
biz-mall/coupon/classes/CouponClass.php

@@ -16,10 +16,7 @@ class CouponClass extends BaseClass
     //获取客户没有使用的优惠券,默认取最新的6张
     public static function getUnUseCoupon($userId, $num = 6)
     {
-        $time = time();
-        //return self::getLimitList('*', ['userId' => $userId, 'status' => 0, 'deadline>' => $time], $num, 'addTime DESC');
-        //deadline字段去掉了
-        return self::getLimitList('*', ['userId' => $userId, 'status' => 0], $num, 'addTime DESC');
+        return [];
     }
 
     //使用优惠券 ssh 2020.3.10

+ 0 - 5
biz-mall/user/services/UserAssetService.php

@@ -34,11 +34,6 @@ class UserAssetService extends BaseService
 		if (isset($asset['member']) && $asset['member'] > 0) {
 			$discount['member'] = ['level' => $asset['member'], 'discount' => $asset['discount']];
 		}
-		//优惠券
-		$couponList = CouponClass::getUnUseCoupon($userId);
-		if (!empty($couponList)) {
-			$discount['coupon'] = $couponList;
-		}
 		return $discount;
 	}
 	

+ 4 - 15
biz/shop/classes/ShopAdminClass.php

@@ -5,6 +5,7 @@ namespace biz\shop\classes;
 use biz\admin\classes\AdminClass;
 use biz\admin\classes\AdminRoleClass;
 use bizGhs\ws\services\WsService;
+use bizHd\staff\classes\StaffClass;
 use bizHd\user\classes\UserClass;
 use common\components\util;
 use Yii;
@@ -180,31 +181,19 @@ class ShopAdminClass extends BaseClass
     {
         $id = $relation->id ?? 0;
         if ($relation->founder == 2) {
-            util::fail("创始人不能删除");
+            util::fail("不能删老板");
         }
         if ($id == $thisShopAdminId) {
             util::fail("不能删自己");
         }
         ShopAdminClass::valid($relation, $mainId);
         $adminId = $relation->adminId ?? 0;
-        $currentShopId = $relation->shopId ?? 0;
         $admin = AdminClass::getById($adminId, true);
         if (empty($admin)) {
             util::fail('没有找到员工信息');
         }
-        $admin->currentGhsShopId = 0;
-        $admin->save();
-        $relation->delStatus = 1;
-        $relation->save();
-        //删除员工关系后,再找出这个员工还有没其它门店员工身份补上
-        if (!empty($admin) && isset($admin->currentShopId) && $admin->currentShopId == $currentShopId) {
-            $has = self::getByCondition(['adminId' => $adminId, 'delStatus' => 0, 'status' => 1], true);
-            $hasCurrentShopId = $has->shopId ?? 0;
-            $admin->currentGhsShopId = $hasCurrentShopId;
-            $admin->save();
-        }
-        // 员工数-1
-        AdminRoleClass::counters(['num' => -1], ['id' => $relation->roleId]);
+        //员工离职,多处使用,关键词 staff_lz
+        StaffClass::executeStaffResignation($admin, $relation);
     }
 
     //根据shopId 获取 员工的shopAdminId

+ 4 - 4
common/components/book.php

@@ -61,7 +61,7 @@ class book
         ]],
         ['class' => '更多', 'icon' => '/book/more.png', 'list' => [
             ['title' => '微信和支付宝开户认证', 'id' => 'upgrade'],
-            ['title' => '换卡和新开户收费标准', 'id' => 'changeCard'],
+            ['title' => '换卡和新开收款账户收费标准', 'id' => 'changeCard'],
             ['title' => '公司地址', 'id' => 'aboutUs'],
         ]],
     ];
@@ -87,10 +87,10 @@ class book
             ['style' => 'video', 'value' => 'jc/1what.mp4'],
         ],
         'changeCard' => [
-            ['style' => 'info', 'value' => '目前更换银行卡和新开户,还没有开发功能出来,所以需要人工提交资料,工作量大,所以需要收费提供服务。',],
+            ['style' => 'info', 'value' => '目前更换银行卡和新开户,还没有开发功能出来,所以需要人工提交资料,工作量大,所以需要收取服务费。',],
             ['style' => 'miniTitle', 'value' => '更换收款银行卡,每次2元。',],
-            ['style' => 'miniTitle', 'value' => '新开收款账户,每次30元。',],
-            ['style' => 'miniTitle', 'value' => '门店转让,需新开收款账户,并更换管理人员的,每次50元。',],
+            ['style' => 'miniTitle', 'value' => '新开收款账户,每次25元。',],
+            ['style' => 'miniTitle', 'value' => '门店转让,需新开收款账户,并更换管理人员的,每次35元。',],
         ],
         'chargeStandard2' => [
             ['style' => 'info', 'value' => '软件年费1580元,年费需每年付一次,客户通过小程序下单,会扣0.33手续费,即100元扣3毛3,付款后不支持退货。',],