diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 6a54f7007..f558109ed 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1365,16 +1365,16 @@ function get_promote_levels($id = 0) $data = M('promote', 'tab_')->field('parent_id, level')->where(array('id' => $id))->find(); switch ($data['level']) { case '1': - return "一级推广员"; + return "会长"; break; case '2': - return "二级推广员"; + return "部门长"; break; case '3': - return "三级推广员"; + return "组长"; break; case '4': - return "四级推广员"; + return "组员"; break; default: diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 8c016e316..d00e64a12 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -63,14 +63,28 @@ class ExportController extends Controller $map['server_name'] = array('like','%'.trim($_REQUEST['server_name']).'%'); unset($_REQUEST['server_name']); } - if (isset($_REQUEST['server_id'])) { + if (isset($_REQUEST['server_id'])) { $map['server_id'] = trim($_REQUEST['server_id']); unset($_REQUEST['server_id']); } + if (isset($_REQUEST['game_type'])) { + $map['sdk_version'] = trim($_REQUEST['game_type']); + unset($_REQUEST['game_type']); + } if (isset($_REQUEST['role_name'])) { $map['role_name'] = array('like','%'.trim($_REQUEST['role_name']).'%'); unset($_REQUEST['role_name']); } + if (isset($_REQUEST['promote_id'])) { + $queryStr = ''; + if ($_REQUEST['promote_id'] == 0) { + $map['promote_id'] = '0'; + } else { + $queryStr = "chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}"; + $promoter_ids = D("Promote")->where($queryStr)->field('id')->select(); + $promoter_ids ? $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; + } + } $xlsData = M('user_play_info', 'tab_') ->where($map) ->order('id desc') @@ -171,7 +185,6 @@ class ExportController extends Controller } break; case 3: - if($_REQUEST['type']==2){ $xlsCell = array( array('id', L('Account_number_ID')), @@ -212,10 +225,34 @@ class ExportController extends Controller } - if (isset($_REQUEST['promote_account'])) { - $map['promote_id'] = get_promote_id(trim(I('promote_account'))); - unset($_REQUEST['promote_account']); + if (isset($_REQUEST['device_number'])) { + $map['tab_user.device_number'] = $_REQUEST['device_number']; + unset($_REQUEST['device_number']); + } + if ($_REQUEST['promote_id'] != '') { + if($_REQUEST['promote_id']=='UC'){ + $map['tab_user.promote_account'] = 'UC用户'; + } else if ($_REQUEST['promote_id']==0) { + $map['tab_user.promote_id'] = 0; + } else{ + $promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select(); + if ($promoter_ids) { + $map['tab_user.promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))]; + } + } + } + $game_map = ""; + if (isset($_REQUEST['game_name'])) { + $game_map .= " and tab_user_play.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")"; } + $game_play_map = ''; + if (isset($_REQUEST['server_name'])) { + $game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' "; + } + // if (isset($_REQUEST['promote_account'])) { + // $map['promote_id'] = get_promote_id(trim(I('promote_account'))); + // unset($_REQUEST['promote_account']); + // } if (isset($_REQUEST['register_way'])) { if($_REQUEST['type']==1) { if ($_GET['register_way'] == 1) { @@ -270,10 +307,12 @@ class ExportController extends Controller $xlsData = M('user', 'tab_')->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,(IFNULL(sum(b.pay_amount),0) + IFNULL(sum(ss.pay_amount),0)) AS recharge_total') ->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1') ->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1') + ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false) + ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false) ->where($map) ->group('tab_user.id') ->order($order) - ->having($havs) + ->having($havs) ->select(); if($xlsData) { $ids = array_column($xlsData,'id'); @@ -640,7 +679,7 @@ class ExportController extends Controller } $map1 = $map; $map1['pay_status'] = 1; - $total = D('Spend')->where($map1)->sum('pay_amount'); + $total = D('Spend')->where($map1)->join($tab_promote_join)->sum('pay_amount'); if (isset($map['pay_status']) && $map['pay_status'] == 0) { $total = sprintf("%.2f", 0); } else { @@ -3101,7 +3140,19 @@ if ($key == 'model'){ } if (isset($_REQUEST['game_id'])) { $map['game_id'] = $_REQUEST['game_id']; - } + } + if (isset($_REQUEST['game_name'])) { + $map['game_name'] = ['like', $_REQUEST['game_name']."%"]; + unset($_REQUEST['game_name']); + } + if (isset($_REQUEST['game_type'])) { + $map['sdk_version'] = $_REQUEST['game_type']; + unset($_REQUEST['game_type']); + } + if (isset($_REQUEST['server_name'])) { + $map['server_name'] = $_REQUEST['server_name']; + unset($_REQUEST['server_name']); + } if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) { $map['login_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1)); }elseif(isset($_REQUEST['timestart'])){ @@ -3111,7 +3162,9 @@ if ($key == 'model'){ } if (isset($_REQUEST['account'])) { $map['user_account'] = array('like', '%' . trim($_REQUEST['account']) . '%'); - } + } + + $map['login_time'] = array('neq', 0); $page = intval($_REQUEST['p']); @@ -3120,7 +3173,7 @@ if ($key == 'model'){ $row = $_REQUEST['row']?$_REQUEST['row']:10; $data = M('UserLoginRecord','tab_') - ->where($map)->order('id desc')->select(); + ->where($map)->order('id desc')->select(); $xlsData = []; @@ -4203,11 +4256,16 @@ if ($key == 'model'){ if($_REQUEST['game_name']=='全部'){ unset($_REQUEST['game_name']); }else{ - $extend['game_name']=['like', "{$_REQUEST['game_name']}%"]; + $map['server_version']=$_REQUEST['server_version']; + $map['game_name']=['like', "{$_REQUEST['game_name']}%"]; unset($_REQUEST['game_name']); } } + if(isset($_REQUEST['server_name'])){ + $map['server_name']=$_REQUEST['server_name']; + unset($_REQUEST['server_name']); + } $model = M('Server','tab_'); if($_REQUEST['type']==2) { diff --git a/Application/Admin/Controller/ServerController.class.php b/Application/Admin/Controller/ServerController.class.php index 62c198fbc..bfdd48ea1 100644 --- a/Application/Admin/Controller/ServerController.class.php +++ b/Application/Admin/Controller/ServerController.class.php @@ -39,6 +39,10 @@ class ServerController extends ThinkController { unset($_REQUEST['game_name']); } } + if(isset($_REQUEST['server_name'])){ + $extend['server_name']=$_REQUEST['server_name']; + unset($_REQUEST['server_name']); + } if(empty($_GET['type']) || $_GET['type'] == 1) { $extend['developers'] = array('EQ',0); }else{ diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index ed47e784a..381a2bb18 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -580,6 +580,10 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ } } + if (isset($_REQUEST['game_type'])) { + $map['sdk_version'] = trim($_REQUEST['game_type']); + unset($_REQUEST['game_type']); + } empty(I('user_account')) || $map['user_account'] = ['like',"%".I('user_account')."%"]; $list = $this->lists(M('user_play_info', 'tab_'), $map, 'play_time desc'); $this->assign('list', $list); diff --git a/Application/Admin/View/Server/lists.html b/Application/Admin/View/Server/lists.html index 1f7f90a50..a7ae99cff 100644 --- a/Application/Admin/View/Server/lists.html +++ b/Application/Admin/View/Server/lists.html @@ -85,6 +85,11 @@ --> +
+ +
- @@ -326,7 +331,24 @@ $(function(){ }); $("#server_version").change(); - + var game_server = "{:I('server_name')}"; + $("#game_name").change(function(){ + $.ajax({ + url:"{:U('Ajax/getGmeServer')}", + type:"post", + data:{sdk_version:$("#server_version option:selected").val(), game_name:$("#game_name option:selected").val()}, + dataType:'json', + success:function(data){ + str = ""; + for (var i in data){ + str += "" + } + $("#server_name").empty(); + $("#server_name").append(str); + $("#server_name").select2(); + } + }) + }); }) diff --git a/Application/Admin/View/User/rolelist.html b/Application/Admin/View/User/rolelist.html index 956fd88b6..9db65838b 100644 --- a/Application/Admin/View/User/rolelist.html +++ b/Application/Admin/View/User/rolelist.html @@ -154,6 +154,9 @@ 'game_name'=>I('game_name'), 'server_id'=>I('server_id'), 'role_name'=>I('role_name'), + 'promote_level'=>I('promote_level'), + 'promote_id'=>I('promote_id'), + 'game_type'=>I('game_type'), 'xlsname'=>'玩家_角色查询', ))}">导出 {$_page} diff --git a/Application/Home/Common/function.php b/Application/Home/Common/function.php index a15e9e67b..892c35e21 100644 --- a/Application/Home/Common/function.php +++ b/Application/Home/Common/function.php @@ -716,16 +716,16 @@ function get_promote_levels($id = 0) $data = M('promote', 'tab_')->field('parent_id, level')->where(array('id' => $id))->find(); switch ($data['level']) { case '1': - return "一级推广员"; + return "会长"; break; case '2': - return "二级推广员"; + return "部门长"; break; case '3': - return "三级推广员"; + return "组长"; break; case '4': - return "四级推广员"; + return "组员"; break; default: