|
|
@@ -170,7 +170,6 @@ class BaseLogic
|
|
|
{
|
|
|
$withSearch = array_keys($searchWhere);
|
|
|
$data = $searchWhere;
|
|
|
-
|
|
|
|
|
|
// 获取游戏权限
|
|
|
$auth_game_list = request()->header('auth_game_list');
|
|
|
@@ -187,17 +186,7 @@ class BaseLogic
|
|
|
}
|
|
|
|
|
|
// 游戏权限
|
|
|
- // if(!empty($auth_game_list)){
|
|
|
- // // 如果传入的game_id存在,则取交集
|
|
|
- // if(!empty($data['game_id'])){
|
|
|
- // $data['game_id'] = array_values(array_intersect(explode(',', $data['game_id']), explode(',', $auth_game_list)));
|
|
|
- // }else{
|
|
|
- // // 如果传入的game_id不存在,则取权限中的game_id
|
|
|
- // $data['game_id'] = $auth_game_list?explode(',', $auth_game_list) : '';
|
|
|
- // }
|
|
|
- // }
|
|
|
if(!empty($auth_game_list)){
|
|
|
- echo '进入auth_game_list';
|
|
|
if(!empty($data['game_id'])){
|
|
|
$inputGameIds = is_array($data['game_id']) ? $data['game_id'] : explode(',', $data['game_id']);
|
|
|
$authGameIds = explode(',', $auth_game_list);
|
|
|
@@ -207,35 +196,52 @@ class BaseLogic
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // // 自然量游戏权限
|
|
|
- // if(!empty($auth_normal_game_list)){
|
|
|
- // // 如果传入的game_id存在,则取交集
|
|
|
- // if(!empty($data['nomal_game_id'])){
|
|
|
- // $data['nomal_game_id'] = array_values(array_intersect(explode(',', $data['nomal_game_id']), explode(',', $auth_normal_game_list)));
|
|
|
- // }else{
|
|
|
- // // 如果传入的game_id不存在,则取权限中的game_id
|
|
|
- // $data['nomal_game_id'] = $auth_normal_game_list?explode(',', $auth_normal_game_list) : '';
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // 广告数据权限
|
|
|
- // 全部
|
|
|
+ // 自然量游戏权限
|
|
|
+ if(!empty($auth_normal_game_list)){
|
|
|
+ $data['nomal_game_id'] = $auth_normal_game_list;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**广告数据权限-开始***************************************** */
|
|
|
+ // 广告数据权限-全公司数据
|
|
|
if($auth_ad_permission==1){
|
|
|
- $data['auth_id'] = [];
|
|
|
+ // 如果传入了auth_id,则取交集
|
|
|
+ if(!empty($data['auth_id'])){
|
|
|
+ $data['auth_id'] = array_values(array_intersect(explode(',', $data['auth_id']), explode(',', $auth_ad_permission)));
|
|
|
+ }else{
|
|
|
+ $data['auth_id'] = '';
|
|
|
+ }
|
|
|
}
|
|
|
- // 自己以及下面组员
|
|
|
+
|
|
|
+ // 广告数据权限-自己以及下面组员
|
|
|
if($auth_ad_permission==2){
|
|
|
+ // 如果没有传入负责人ID, 则取当前用户以及下面组员
|
|
|
$current_user_id = $this->adminInfo['id'];
|
|
|
$result = Db::connect('db_system')->table('sa_system_user')->field('dept_id')->where('id', $current_user_id)->select()->toArray();
|
|
|
$dept_ids = array_column($result, 'dept_id');
|
|
|
$under_user_ids = Db::connect('db_system')->table('sa_system_user')->field('id')->where('dept_id', 'in', $dept_ids)->select()->toArray();
|
|
|
$under_user_ids = array_column($under_user_ids, 'id');
|
|
|
- $data['auth_id'] = $under_user_ids;
|
|
|
+
|
|
|
+ if(!empty($data['auth_id'])){
|
|
|
+ // 如果传入了负责人ID,则取交集
|
|
|
+ $data['auth_id'] = array_values(array_intersect(explode(',', $data['auth_id']), array_values($under_user_ids)));
|
|
|
+ }else{
|
|
|
+ // 如果没有传入负责人ID, 则取当前用户以及下面组员
|
|
|
+ $data['auth_id'] = array_values($under_user_ids);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 广告数据权限-如果auth_id为空,则取当前用户
|
|
|
+ if($auth_ad_permission==''){
|
|
|
+ $current_user_id = $this->adminInfo['id'];
|
|
|
+ if(!empty($data['auth_id'])){
|
|
|
+ // 如果传入了负责人ID,则取交集
|
|
|
+ $data['auth_id'] = array_values(array_intersect(explode(',', $data['auth_id']), array_values($under_user_ids)));
|
|
|
+ }else{
|
|
|
+ // 如果没有传入负责人ID, 则取当前用户
|
|
|
+ $data['auth_id'] = $current_user_id;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- // return $data;
|
|
|
- // print_r($data);
|
|
|
- // return $this->model->withSearch($withSearch, $data);
|
|
|
+ /**广告数据权限-结束***************************************** */
|
|
|
return $data;
|
|
|
}
|
|
|
|