ith5 5 ヶ月 前
コミット
2098dbdd9c

+ 9 - 0
app/v1/logic/center/GameLogic.php

@@ -61,6 +61,7 @@ class GameLogic extends BaseLogic
         $hasPackage = $where['has_package']??false;
         unset($where['has_package']);
         $authGameList = request()->header('auth_game_list');
+        echo 'authGameList:'.$authGameList;
         $query = $this->search($where);
         if(!empty($authGameList)) {
             $authGameList = explode(',', $authGameList);
@@ -118,6 +119,14 @@ class GameLogic extends BaseLogic
                 'name' => $group['name'],
                 'children' => $groupGames
             ];
+
+
+        }
+
+        foreach($result as $key => $value){
+            if(empty($value['children'])){
+                unset($result[$key]);
+            }
         }
 
         return $result;

+ 1 - 1
app/v1/logic/dataReport/ChannelAnalysisLogic.php

@@ -27,7 +27,7 @@ class ChannelAnalysisLogic extends BaseLogic
             SUM(reg_pay_total_rg) as reg_pay_total_rg";
         $group = 'agent_id,thour';
         $whereSql = $this->generateWhereSql($params);
-
+    
         // 根据日期,连表查询
         $tableNames = ToolLogic::getMonthlyTableNames('base_total_hour_', $where['reg_date'][0], $where['reg_date'][1]);
         $sqlParts = [];

+ 10 - 1
app/v1/middleware/FilterPermission.php

@@ -27,7 +27,16 @@ class FilterPermission implements MiddlewareInterface
         if(in_array(1,$currentUserRoleList)){
             $authGameList = '';
         }else{
-            $authGameList = $user_info['game_list'] ?? '';
+            // 根据部门的游戏权限
+            $result = Db::connect('db_system')->table('sa_system_user')->field('dept_id')->where('id', $user_info['id'])->find();
+            $departmentId = $result['dept_id'] ?? 0;
+            $departmentInfo = Db::connect('db_system')->table('sa_system_dept')->where('id',$departmentId)->find();
+            $departmentGameList = $departmentInfo['game_list'] ?? '';
+            $authGameList = $departmentGameList;
+            if($departmentGameList=='*'){
+                $authGameList = '';
+            }
+            
         }
 
         // 获取游戏自然量数据权限

+ 3 - 1
plugin/saiadmin/basic/BaseLogic.php

@@ -186,12 +186,15 @@ class BaseLogic
         }
         
         // 游戏权限
+        
         if(!empty($authGameList)){
             if(!empty($data['game_id'])){
+                // 如果传入了game_id,则取权限交集
                 $inputGameIds = is_array($data['game_id']) ? $data['game_id'] : explode(',', $data['game_id']);
                 $authGameIds = explode(',', $authGameList);
                 $data['game_id'] = array_values(array_intersect($inputGameIds, $authGameIds));
             }else{
+                // 如果没传入game_id,则取权限
                 $data['game_id'] = $authGameList ? explode(',', $authGameList) : '';
             }
         }
@@ -209,7 +212,6 @@ class BaseLogic
 
             if(!empty($data['auth_id'])){
                // 如果传入了负责人ID,则取交集
-               print_r($under_user_ids);
                $data['auth_id'] = array_values(array_intersect( $data['auth_id'], array_values($under_user_ids)));
             }else{
                 // 如果没有传入负责人ID, 则取当前用户以及下面组员