shish 4 лет назад
Родитель
Сommit
ca2cf9e00d
1 измененных файлов с 4 добавлено и 10 удалено
  1. 4 10
      app-ghs/controllers/CustomController.php

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

@@ -206,11 +206,8 @@ class CustomController extends BaseController
     public function actionUpdateDebtLimit()
     public function actionUpdateDebtLimit()
     {
     {
         $shopAdmin = $this->shopAdmin;
         $shopAdmin = $this->shopAdmin;
-        $roleId = $shopAdmin['roleId'] ?? 0;
-        $role = AdminRoleClass::getById($roleId);
-        $roleName = $role['roleName'] ?? '';
-        if ($roleName == '员工') {
-            util::fail('您没有权限操作哦');
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('管理员才能操作');
         }
         }
 
 
         $get = Yii::$app->request->get();
         $get = Yii::$app->request->get();
@@ -230,11 +227,8 @@ class CustomController extends BaseController
     public function actionChangeDiscount()
     public function actionChangeDiscount()
     {
     {
         $shopAdmin = $this->shopAdmin;
         $shopAdmin = $this->shopAdmin;
-        $roleId = $shopAdmin['roleId'] ?? 0;
-        $role = AdminRoleClass::getById($roleId);
-        $roleName = $role['roleName'] ?? '';
-        if ($roleName == '员工') {
-            util::fail('您没有权限操作哦');
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('管理员才能操作');
         }
         }
 
 
         $get = Yii::$app->request->get();
         $get = Yii::$app->request->get();