Ver código fonte

权限管理

shish 2 anos atrás
pai
commit
bfa939c22b
1 arquivos alterados com 6 adições e 4 exclusões
  1. 6 4
      app-ghs/controllers/ShopController.php

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

@@ -125,16 +125,18 @@ class ShopController extends BaseController
     public function actionUpdate()
     {
         $post = Yii::$app->request->post();
-        $adminId = $this->adminId;
         $post['sjId'] = $this->sjId;
         $id = $post['id'] ?? 0;
         $shop = ShopService::getById($id);
         if (empty($shop)) {
             util::fail('没有找到门店');
         }
-        $ptSuperAdminId = \biz\admin\classes\AdminClass::getPtSuperAdminId();
-        if ($adminId != $shop->adminId && $adminId != $ptSuperAdminId) {
-            //util::fail('本店超管才能修改');
+        $staff = $this->shopAdmin;
+        if (isset($staff->finance) == false || $staff->finance == 0) {
+            util::fail('有财务权限才能修改门店');
+        }
+        if (isset($staff->super) == false || $staff->super == 0) {
+            util::fail('有改库存改价权限才能修改门店');
         }
 
         ShopClass::valid($shop, $this->sjId);