shish 4 lat temu
rodzic
commit
5f8d1aa431
1 zmienionych plików z 6 dodań i 5 usunięć
  1. 6 5
      app-ghs/controllers/ShopAdminController.php

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

@@ -202,6 +202,12 @@ class ShopAdminController extends BaseController
         $remind = $post['remind'] ?? 0;
         $status = $post['status'] ?? 1;
         $super = $post['super'] ?? 0;
+
+        $founder = $relation->founder ?? 1;
+        if ($founder == 2 && $super == 0) {
+            util::fail('不能关闭超管权限');
+        }
+
         $relation->roleId = $roleId;
         $relation->remind = $remind;
         $relation->status = $status;
@@ -211,11 +217,6 @@ class ShopAdminController extends BaseController
         }
         $relation->save();
 
-        $founder = $relation->founder ?? 1;
-        if ($founder == 2 && $super == 0) {
-            util::fail('不能关闭超管权限');
-        }
-
         //若有传密码,则修改密码
         $password = $post['password'] ?? '';
         if (!empty($password)) {