shish преди 2 години
родител
ревизия
8a7eef8103
променени са 3 файла, в които са добавени 11 реда и са изтрити 10 реда
  1. 3 4
      app-ghs/controllers/ShopController.php
  2. 3 4
      app-hd/controllers/ShopController.php
  3. 5 2
      biz/shop/classes/ShopAdminClass.php

+ 3 - 4
app-ghs/controllers/ShopController.php

@@ -289,11 +289,10 @@ class ShopController extends BaseController
     //切换门店 lqh 2021.1.31
     public function actionToggleShop()
     {
-        //惠雅、昱成、问境、丰行员工不能切换门店,二个地方要修改
         $shopAdmin = $this->shopAdmin;
-        $adminId = $shopAdmin->adminId ?? 0;
-        if (in_array($adminId, [2812, 3539, 3735, 3407, 9604, 10097, 5180])) {
-            util::fail('不允许切换门店');
+        $switchShop = ShopAdminClass::hasSwitchShopRight($shopAdmin);
+        if ($switchShop == 0) {
+            util::fail('不切换门店');
         }
 
         $newShopId = Yii::$app->request->post('shopId', 0);

+ 3 - 4
app-hd/controllers/ShopController.php

@@ -152,11 +152,10 @@ class ShopController extends BaseController
     //切换门店 lqh 2021.1.31
     public function actionToggleShop()
     {
-        //惠雅、昱成、问境、丰行员工不能切换门店,二个地方要修改
         $shopAdmin = $this->shopAdmin;
-        $adminId = $shopAdmin->adminId ?? 0;
-        if (in_array($adminId, [2812, 3539, 3735, 3407, 9604, 10097, 5180])) {
-            util::fail('不允许切换门店');
+        $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin);
+        if ($switchShop == 0) {
+            util::fail('不切换门店');
         }
 
         $newShopId = Yii::$app->request->post('shopId', 0);

+ 5 - 2
biz/shop/classes/ShopAdminClass.php

@@ -164,8 +164,11 @@ class ShopAdminClass extends BaseClass
     //是否有切换门店权限 0不是 1是
     public static function hasSwitchShopRight($shopAdmin)
     {
-        $super = isset($shopAdmin->super) && $shopAdmin->super == 1 ? 1 : 0;
-        return $super;
+        $hasRight = 0;
+        if ($shopAdmin->switchShop == 1) {
+            $hasRight = 1;
+        }
+        return $hasRight;
     }
 
     //删除员工 ssh 2021.5.3