PC-202304251453\Administrator hai 5 meses
pai
achega
2eea8a946c
Modificáronse 1 ficheiros con 16 adicións e 10 borrados
  1. 16 10
      plugin/saiadmin/basic/BaseLogic.php

+ 16 - 10
plugin/saiadmin/basic/BaseLogic.php

@@ -342,11 +342,6 @@ class BaseLogic
 
         $userAuthCache = new UserInfoCache(getCurrentInfo()['id']);
         $userInfo = $userAuthCache->getUserInfo();
-        // Todo 如果角色权限,超过跳过权限限制
-        $roleIds = array_column($userInfo['roleList'], 'id');
-        if (in_array(1, $roleIds)) {
-            return $data;
-        }
 
         // Todo 1、游戏权限
         $authGameList = $userInfo['deptList']['game_list'];
@@ -362,7 +357,13 @@ class BaseLogic
             }
         }
 
-        // Todo 2、广告数据权限
+        // Todo 2、 如果角色权限,超过跳过权限限制
+        $roleIds = array_column($userInfo['roleList'], 'id');
+        if (in_array(1, $roleIds)) {
+            return $data;
+        }
+
+        // Todo 3、广告数据权限
         $userId = $userInfo['id'];
         $deptId = $userInfo['deptList']['id'];
         // 广告权限,自己 or 全部
@@ -380,13 +381,18 @@ class BaseLogic
             }
         }
 
-        // 看指定游戏的自然量
+        // Todo 4、看指定游戏的自然量
         $authNormalGameList = $userInfo['normal_game_list']; // 可看自然量的游戏
-        if ($authNormalGameList != '*' && $authNormalGameList != '-1' && !empty($data['game_id'])) {
-            // 则取auth_normal_game_list交集
-            $data['normal_game_id'] = array_values(array_intersect(explode(',', $authNormalGameList), $data['game_id']));
+        if($data['game_id']){
+            if($authNormalGameList=="*"){
+                $data['normal_game_id'] = $data['game_id'];
+            }elseif ($authNormalGameList!='-1') {
+                // 则取auth_normal_game_list交集
+                $data['normal_game_id'] = array_values(array_intersect(explode(',', $authNormalGameList), $data['game_id']));
+            }
         }
 
+
         return $data;
     }