From dfdc31f4dc079e3e87ec8c9f3ecbf3b9b5c88d1f Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Mon, 9 Nov 2020 21:17:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E4=B8=93=E5=91=98=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=98=BE=E7=A4=BA=E9=80=9A=E8=BF=87=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 2 +- .../AuthManagerController.class.php | 11 +- .../Controller/ExportController.class.php | 113 ++++++++++-------- .../Controller/MemberController.class.php | 7 +- .../Controller/SpendController.class.php | 1 + .../Admin/Controller/UserController.class.php | 1 + Application/Admin/Model/MemberModel.class.php | 1 + .../Admin/View/AuthManager/dataempower.html | 61 ++++++---- Application/Admin/View/Member/user_info.html | 6 +- Application/Admin/View/Spend/lists.html | 6 +- Application/Admin/View/User/rolelist.html | 8 +- 11 files changed, 136 insertions(+), 81 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 345c47ce2..82fb34f9a 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1585,7 +1585,7 @@ function getGameList($partner_id) { function getAdminData ($uid) { $adminData = M('auth_group_access') - ->field('data_empower_type,data_president,show_data') + ->field('data_empower_type,data_president,show_data,show_market_admin') ->join('left join sys_auth_group on sys_auth_group_access.group_id=sys_auth_group.id') ->where(array('uid'=>$uid))->find(); diff --git a/Application/Admin/Controller/AuthManagerController.class.php b/Application/Admin/Controller/AuthManagerController.class.php index cbd5bd396..060aa44cc 100644 --- a/Application/Admin/Controller/AuthManagerController.class.php +++ b/Application/Admin/Controller/AuthManagerController.class.php @@ -527,12 +527,13 @@ class AuthManagerController extends AdminController{ $auth_group = M('AuthGroup')->where( array('status'=>array('egt','0'),'module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) ) ->getfield('id,id,title,rules'); // var_dump($auth_group);die(); - $empower_type = M('AuthGroup')->field('data_empower_type,show_data')->where(array('id'=>$_GET['group_id']))->find(); + $empower_type = M('AuthGroup')->field('data_empower_type,show_data,show_market_admin')->where(array('id'=>$_GET['group_id']))->find(); // var_dump($empower_type);die(); $this->assign('data_empower_type', $empower_type['data_empower_type']); $this->assign('show_data', $empower_type['show_data']); $this->assign('auth_group', $auth_group); + $this->assign('show_market_admin', $empower_type['show_market_admin']); $this->display(); } @@ -542,6 +543,7 @@ class AuthManagerController extends AdminController{ $gid = I('group_id'); $data_empower_type = I('data_empower_type'); $show_data = I('show_data'); + $show_market_admin = I('show_market_admin'); $promoteData = I('promote_data'); // dump(json_decode($promoteData,true)); @@ -567,9 +569,10 @@ class AuthManagerController extends AdminController{ } if ($AuthGroup->where("id = {$gid}")->save(array( - 'data_empower_type'=>$data_empower_type, - 'data_president'=>$promoteData, - 'show_data'=>$show_data + 'data_empower_type' => $data_empower_type, + 'data_president' => $promoteData, + 'show_data' => $show_data, + 'show_market_admin' => $show_market_admin, ))) { resetUserAuth(); diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 9ba1a1aa9..f4e1b387a 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -55,19 +55,26 @@ class ExportController extends Controller $xlsName = $_REQUEST['xlsname']; switch ($id) { case 1: -// $xlsCell = array( -// array('user_account', "玩家账号"), -// array('game_name', "游戏名称"), -// array('server_name', L('Game_area_clothing')), -// array('role_name', "角色名"), -// array('role_level', "游戏等级"), -// array('play_time', "最后登录时间", 'time_format', '*'), -// array('play_ip', "最后登录ip"), -// ); - $xlsCell = array( - "创建时间","玩家账号", "游戏名称","游戏区服", L('Game_area_clothing'), "角色ID", "角色名", "游戏等级","推广员ID", "所属推广员", - "最后登录时间", '最后登录ip','所属市场专员' - ); + $showMarketAdmin = session('user_auth')['show_market_admin']; + $headers = [ + 'create_time' => '创建时间', + 'user_account' => '玩家账号', + 'game_name' => '游戏名称', + 'server_id' => '游戏区服', + 'server_name' => L('Game_area_clothing'), + 'role_id' => '角色ID', + 'role_name' => '角色名', + 'role_level' => '游戏等级', + 'promote_id' => '所属市场专员', + 'promote_account' => '所属推广员', + 'play_time' => '最后登录时间', + 'play_ip' => '最后登录ip', + ]; + $xlsCell = array_values($headers); + $fields = array_keys($headers); + if ($showMarketAdmin == 0) { + unset($headers['promote_id']); + } if (isset($_REQUEST['game_name'])) { $map['game_name'] = ['like', trim($_REQUEST['game_name'])."%"]; unset($_REQUEST['game_name']); @@ -95,14 +102,6 @@ class ExportController extends Controller $map = withMarketAdminCondition($map, I('market_admin_id', 0)); -// $promoteRoot = getPowerPromoteIds(); -// $data_empower_type = session('user_auth')['data_empower_type']; -// -// if ($promoteRoot) { -// $map['promote_id'] =array('in',$promoteRoot); -// } else if(!$promoteRoot&&$data_empower_type!=1){ -// $map['id'] = array('lt',1); -// } setPowerPromoteIds($map,'promote_id'); if (isset($_REQUEST['promote_id'])) { @@ -140,7 +139,6 @@ class ExportController extends Controller ->where($map) ->order('play_time desc') ->count(); -// $accessNum =$accessNum['count']; $perSize = 5000;//每次查询的条数 $pages = ceil($accessNum / $perSize); @@ -150,16 +148,20 @@ class ExportController extends Controller for($i = 1; $i <= $pages; $i++) { $xlsData = M('user_play_info', 'tab_') - ->field("create_time,user_account,game_name,server_id,server_name,role_id,role_name,role_level,promote_id,promote_account,play_time,play_ip") + ->field($fields) ->where($map) ->limit(($i-1)*$perSize ,$perSize) ->order('play_time desc') ->select(); - $adminList = getMarketAdminsByPromoteIds(array_column($xlsData, 'promote_id')); + if ($showMarketAdmin == 1) { + $adminList = getMarketAdminsByPromoteIds(array_column($xlsData, 'promote_id')); + } foreach($xlsData as $value) { ($value['promote_account']=='官方渠道'||$value['promote_account']=='自然注册')?($value['promote_account']=C('OFFICIEL_CHANNEL')):''; - $value['market_admin_username'] = isset($adminList[$value['promote_id']]) && $adminList[$value['promote_id']]['admin'] ? $adminList[$value['promote_id']]['admin']['username'] : '无'; + if ($showMarketAdmin == 1) { + $value['promote_id'] = isset($adminList[$value['promote_id']]) && $adminList[$value['promote_id']]['admin'] ? $adminList[$value['promote_id']]['admin']['username'] : '无'; + } $value['create_time'] = date("Y-m-d H:i:s",$value['create_time']); $value['play_time'] = date("Y-m-d H:i:s",$value['play_time']); mb_convert_variables('GBK', 'UTF-8', $value); @@ -1149,14 +1151,6 @@ class ExportController extends Controller $map['market_admin_id'] = $userAuth['uid']; } -// $promoteRoot = getPowerPromoteIds(); -// $data_empower_type = session('user_auth')['data_empower_type']; -// -// if ($promoteRoot) { -// $map['promote_id'] =array('in',$promoteRoot); -// } else if(!$promoteRoot&&$data_empower_type!=1){ -// $map['id'] = array('lt',1); -// } setPowerPromoteIds($map,'promote_id'); if (isset($_REQUEST['promote_id'])) { @@ -1204,11 +1198,38 @@ class ExportController extends Controller // var_dump($total);die(); $total=$total?$total:0; + $showMarketAdmin = session('user_auth')['show_market_admin']; + + $headers = [ + 'pay_order_number' => '支付订单号', + 'extend' => 'CP订单号', + 'pay_time' => '充值时间', + 'payed_time' => '支付时间', + 'user_account' => '玩家账号', + 'game_name' => '游戏名称', + 'promote_account' => L('Subordinate_channel'), + '0 as company_name' => '所属推广公司', + 'market_admin_id' => '所属市场专员', + 'merchant_id' => '所属商户', + 'spend_ip' => '充值ip', + 'server_id' => '区服ID', + 'server_name' => '游戏区服', + 'game_player_id' => '角色ID', + 'game_player_name' => '角色名称', + 'cost' => '订单金额', + 'pay_amount' => '实付金额', + 'pay_way' => '充值方式', + 'pay_status' => L('Order_status'), + 'pay_game_status' => '游戏通知状态', + 'promote_id' => "消费"."{$total}", + ]; - $xlsCell = array( - "支付订单号","CP订单号", "充值时间","支付时间", "玩家账号", "游戏名称", L('Subordinate_channel'), "所属推广公司", "所属市场专员","所属商户", "充值ip","区服ID", "游戏区服", - "角色ID","角色名称", "订单金额", "实付金额", "充值方式", L('Order_status'), "游戏通知状态", "消费"."{$total}" - ); + if ($showMarketAdmin == 0) { + unset($headers['market_admin_id']); + } + + $xlsCell = array_values($headers); + $fields = array_keys($headers); $csvFileName = $xlsName.'.csv'; //设置好告诉浏览器要下载excel文件的headers @@ -1232,20 +1253,14 @@ class ExportController extends Controller // var_dump($count);die(); for($i = 1; $i <= $pages; $i++) { $xlsData = D('Spend') -// ->field('pay_order_number,extend,pay_time,user_account,game_name,promote_account,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') -// ->where($map) -// ->limit(($i-1)*$perSize ,$perSize) -// ->join($tab_promote_join) -// ->order('pay_time DESC') -// ->select(); - ->field('pay_order_number,extend,pay_time,payed_time,user_account,game_name,promote_account, 0 as company_name,market_admin_id,merchant_id,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status, promote_id') - // ->join('tab_promote on tab_promote.id = tab_spend.promote_id', 'left') - // ->join('tab_promote_company on tab_promote_company.id and tab_promote.company_id', 'left') + ->field($fields) ->where($map) ->limit(($i-1)*$perSize ,$perSize) ->order($order ? $order : 'pay_time desc') ->select(); - $adminUsernameList = getAdminUsernameList(array_column($xlsData, 'market_admin_id')); + if ($showMarketAdmin == 1) { + $adminUsernameList = getAdminUsernameList(array_column($xlsData, 'market_admin_id')); + } $promoters = D('Promote')->where(['id'=>['in', array_unique(array_column($xlsData, 'promote_id'))]])->field('id, company_id')->select(); $promoters = $promoters ? array_column($promoters, 'company_id', 'id') : []; $companys = $promoters ? M('promote_company', 'tab_')->where(['id'=>['in', array_unique(array_values($promoters))]])->field('id, company_name')->select() : []; @@ -1268,7 +1283,9 @@ class ExportController extends Controller $value['pay_way'] = get_pay_way($value['pay_way']); $value['pay_status'] = get_info_status($value['pay_status'],9); $value['pay_game_status'] = get_info_status($value['pay_game_status'],14); - $value['market_admin_id'] = $adminUsernameList[$value['market_admin_id']] ?? '无'; + if ($showMarketAdmin == 1) { + $value['market_admin_id'] = $adminUsernameList[$value['market_admin_id']] ?? '无'; + } mb_convert_variables('GBK', 'UTF-8', $value); fputcsv($fp, $value); } diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 60ec6ad34..2a7801cfe 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -170,7 +170,7 @@ class MemberController extends ThinkController foreach ($data as $key=>$value ) { ($data[$key]['promote_account']=='官方渠道'||$data[$key]['promote_account']=='自然注册')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):''; } -// dump($data);die(); + $showMarketAdmin = session('user_auth')['show_market_admin']; if(isset($_REQUEST['export'])){ $isadmin = is_administrator(); //获取等级 @@ -221,6 +221,9 @@ class MemberController extends ThinkController "small_count"=>"小号","vip_level"=>"VIP等级","register_type"=>"注册方式","register_time"=>"注册时间","register_ip"=>"注册IP","login_time"=>"最后登录时间", "device_number"=>"设备号","is_repeat"=>"去重数据","lock_remark"=>"锁定备注","lock_status"=>"账号状态","check_status"=>"拉黑状态" ); + if ($showMarketAdmin == 0) { + unset($field['market_admin_username']); + } //操作日志 unset($_GET['export']); addOperationLog(array( @@ -282,7 +285,7 @@ class MemberController extends ThinkController $this->assign('marketAdmins', getMarketAdmins()); $this->assign('repeat_count',$repeat_count); $this->assign('no_repeat_count',$no_repeat_count); - + $this->assign('showMarketAdmin', $showMarketAdmin); $this->assign('user_count',$user_count); $this->assign('now_count', $userDbRes['recharge_total']); $page = set_pagination($user_count, $row); diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index 270745826..2c8fd3cc1 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -149,6 +149,7 @@ class SpendController extends ThinkController $value['market_admin_username'] = $adminUsernameList[$value['market_admin_id']] ?? '无'; } + $this->assign('showMarketAdmin', session('user_auth')['show_market_admin']); $this->assign('isMarketAdmin', $isMarketAdmin); $this->assign('marketAdmins', getMarketAdmins()); $this->assign('startDate', $startDate); diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 9f4bcf646..61237e7d9 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -750,6 +750,7 @@ class UserController extends AdminController $value['market_admin_username'] = isset($adminList[$value['promote_id']]) && $adminList[$value['promote_id']]['admin'] ? $adminList[$value['promote_id']]['admin']['username'] : '无'; } + $this->assign('showMarketAdmin', session('user_auth')['show_market_admin']); $this->assign('list', $list); $this->meta_title = '角色数据'; diff --git a/Application/Admin/Model/MemberModel.class.php b/Application/Admin/Model/MemberModel.class.php index 9469f49c3..5e51e9f25 100644 --- a/Application/Admin/Model/MemberModel.class.php +++ b/Application/Admin/Model/MemberModel.class.php @@ -82,6 +82,7 @@ class MemberModel extends Model { 'data_empower_type'=>$adminData['data_empower_type'], 'data_president'=>$adminData['data_president'], 'show_data'=>$adminData['show_data'], + 'show_market_admin'=>$adminData['show_market_admin'], ); //登录有效时间改为1小时 $expireTime = 3600; diff --git a/Application/Admin/View/AuthManager/dataempower.html b/Application/Admin/View/AuthManager/dataempower.html index 2237a2e47..25e467fc3 100644 --- a/Application/Admin/View/AuthManager/dataempower.html +++ b/Application/Admin/View/AuthManager/dataempower.html @@ -45,18 +45,18 @@ 数据授权类型: - - - - - - + + + + + + @@ -65,16 +65,33 @@ 数据展示权限: - - - - + + + + + + + + + + 是否显示市场专员: + + + + + diff --git a/Application/Admin/View/Member/user_info.html b/Application/Admin/View/Member/user_info.html index d5b8ca482..b20adb488 100644 --- a/Application/Admin/View/Member/user_info.html +++ b/Application/Admin/View/Member/user_info.html @@ -163,7 +163,7 @@ - +
- +
@@ -137,7 +137,9 @@ 角色名 游戏等级 所属推广员 - 所属市场专员 + + 所属市场专员 + 最后登录时间 最后登录IP @@ -172,7 +174,9 @@ {$data.promote_account|encryptStr} + {$data.market_admin_username} + {$data.play_ip}