Browse Source

专用账号,不能切换门店

shish 1 year ago
parent
commit
310c032782
2 changed files with 33 additions and 10 deletions
  1. 13 10
      app-ghs/controllers/ShopController.php
  2. 20 0
      app-hd/controllers/ShopController.php

+ 13 - 10
app-ghs/controllers/ShopController.php

@@ -369,18 +369,21 @@ class ShopController extends BaseController
     {
         $mainId = $this->mainId;
         $adminId = $this->adminId;
+        //多处要同步修改,关键词 no_allow_toggle_shop
         if (getenv('YII_ENV') == 'production') {
-            //安海恋善指定人不能切换门店
+            //安海恋善不允许切换门店
             if (in_array($mainId, [44759, 56314, 56315, 56452])) {
                 if (in_array($adminId, [54630, 54723])) {
-                    util::fail('不能切换门店,原因是容易误操作或收银机登录使用');
+                    util::fail('专用账号,不允许切换门店');
                 }
             }
-        } else {
-            if (in_array($mainId, [644])) {
-                if (in_array($adminId, [919])) {
-                    //util::fail('不能切换门店,原因是容易误操作或收银机登录使用');
-                }
+            //惠雅南城不允许切换门店
+            if ($mainId == 52 && $adminId == 3539) {
+                util::fail('收银专用账号,不允许切换门店');
+            }
+            //惠雅莞城不允许切换门店
+            if ($mainId == 1459 && $adminId == 2812) {
+                util::fail('收银专用账号,不允许切换门店');
             }
         }
 
@@ -584,13 +587,13 @@ class ShopController extends BaseController
         if ($shopId <= 0) {
             util::fail('门店数据错误');
         }
-        $shopExt = ShopExtClass::getByCondition(['shopId'=>$shopId], false, false, 'id, shopId, purchaseGuide');
-        if ($shopExt['purchaseGuide'] > 0){
+        $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], false, false, 'id, shopId, purchaseGuide');
+        if ($shopExt['purchaseGuide'] > 0) {
             $picText = PicTextClass::getById($shopExt['purchaseGuide'], false, 'id, title');
         }
         if ($shopExt) {
             $shopExt['title'] = isset($picText['title']) ? $picText['title'] : '';
-            util::success(['shopExt'=>$shopExt]);
+            util::success(['shopExt' => $shopExt]);
         }
         util::fail('获取数据失败');
     }

+ 20 - 0
app-hd/controllers/ShopController.php

@@ -155,6 +155,26 @@ class ShopController extends BaseController
     //切换门店 lqh 2021.1.31
     public function actionToggleShop()
     {
+        $adminId = $this->adminId;
+        $mainId = $this->mainId;
+        //多处要同步修改,关键词 no_allow_toggle_shop
+        if (getenv('YII_ENV') == 'production') {
+            //安海恋善不允许切换门店
+            if (in_array($mainId, [44759, 56314, 56315, 56452])) {
+                if (in_array($adminId, [54630, 54723])) {
+                    util::fail('专用账号,不允许切换门店');
+                }
+            }
+            //惠雅南城不允许切换门店
+            if ($mainId == 52 && $adminId == 3539) {
+                util::fail('收银专用账号,不允许切换门店');
+            }
+            //惠雅莞城不允许切换门店
+            if ($mainId == 1459 && $adminId == 2812) {
+                util::fail('收银专用账号,不允许切换门店');
+            }
+        }
+
         $shopAdmin = $this->shopAdmin;
         $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin);
         if ($switchShop == 0) {