shish 2 years ago
parent
commit
d075f07e84
1 changed files with 5 additions and 4 deletions
  1. 5 4
      app-ghs/controllers/ShopAdminController.php

+ 5 - 4
app-ghs/controllers/ShopAdminController.php

@@ -59,8 +59,8 @@ class ShopAdminController extends BaseController
         if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
             util::fail('没有权限');
         }
-        $founder = $shopAdmin->founder ?? 1;
         $adminId = $this->adminId;
+        $shop = $this->shop;
 
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
@@ -72,7 +72,7 @@ class ShopAdminController extends BaseController
             $name = $post['name'] ?? '';
             $finance = $post['finance'] ?? 0;
             $switchShop = $post['switchShop'] ?? 0;
-            if ($founder != 2 && $adminId != 4) {
+            if ($shop->adminId != $adminId && $adminId != 4) {
                 if ($finance == 1) {
                     util::fail('超管才能开启员工财务权限');
                 }
@@ -222,6 +222,7 @@ class ShopAdminController extends BaseController
         $id = $post['id'] ?? 0;
         $shopAdmin = $this->shopAdmin;
         $adminId = $this->adminId;
+        $shop = $this->shop;
         if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
             util::fail('没有权限');
         }
@@ -243,9 +244,9 @@ class ShopAdminController extends BaseController
         $finance = $post['finance'] ?? 0;
         $switchShop = $post['switchShop'] ?? 0;
         $founder = $relation->founder ?? 1;
-        if ($founder != 2 && $adminId != 4) {
+        if ($shop->adminId != $adminId && $adminId != 4) {
             if ($finance == 1) {
-                util::fail('超管才能修改财务权限'.$founder.' '.$adminId);
+                util::fail('超管才能修改财务权限');
             }
             if ($switchShop == 1) {
                 util::fail('超管才能修改管理分店权限');