shish 4 éve
szülő
commit
e618f70da7
1 módosított fájl, 8 hozzáadás és 2 törlés
  1. 8 2
      app-hd/controllers/ShopAdminController.php

+ 8 - 2
app-hd/controllers/ShopAdminController.php

@@ -41,6 +41,12 @@ class ShopAdminController extends BaseController
     //添加员工
     public function actionAddStaff()
     {
+
+        $shopAdmin = $this->shopAdmin;
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('没有权限');
+        }
+
         $post = Yii::$app->request->post();
         $authCode = $post['authCode'] ?? '';
         $mobile = $post['mobile'] ?? '';
@@ -188,14 +194,15 @@ class ShopAdminController extends BaseController
         $roleId = $post['roleId'] ?? 0;
         $remind = $post['remind'] ?? 0;
         $status = $post['status'] ?? 1;
+        $super = $post['super'] ?? 0;
         $relation->roleId = $roleId;
         $relation->remind = $remind;
         $relation->status = $status;
+        $relation->super = $super;
         if (isset($post['name']) && !empty($post['name'])) {
             $relation->name = $post['name'];
         }
         $relation->save();
-
         //若有传密码,则修改密码
         $password = $post['password'] ?? '';
         if (!empty($password)) {
@@ -203,7 +210,6 @@ class ShopAdminController extends BaseController
             $password = password_hash($password, PASSWORD_BCRYPT);
             AdminClass::updateById($adminId, ['password' => $password]);
         }
-
         util::complete('修改成功');
     }