diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 260683adb..c56c787d4 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -80,18 +80,17 @@ class MemberController extends ThinkController if (isset($_REQUEST['viplevel'])) { $havs = get_vip_level_limit('recharge_total', $_REQUEST['viplevel']); } - //1.2 与游戏相关 - $game_map = false; + //1.2 与游戏相关 查询游戏玩家表 + $gameplay =false; if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { - - $game_map = " and tab_user_play_info.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; + $gameplay = " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; } - if (isset($_REQUEST['server_name'])) { - if($game_map){ - $game_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' "; - }else{ - $game_map = " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' "; - } + //查询游戏角色表 + $game_map = false; + if (isset($_REQUEST['server_id'])) { //有区服,一定有游戏 + $gameplay =false; + $game_map = " and tab_user_play_info.server_id = '{$_REQUEST['server_id']}' "; + $game_map .= " and tab_user_play_info.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; } $promoteRoot = getPowerPromoteIds(); @@ -143,6 +142,11 @@ class MemberController extends ThinkController if($havs){ $data->having($havs); } + if($gameplay){ + $data->join(" + (select user_id from tab_user_play where 1 $gameplay group by tab_user_play.user_id) a ON a.user_id = tab_user.id + "); + } if($game_map){ $data->join(" (select user_id from tab_user_play_info where 1 $game_map group by tab_user_play_info.user_id) a ON a.user_id = tab_user.id @@ -167,6 +171,11 @@ class MemberController extends ThinkController (select user_id from tab_user_play_info where 1 $game_map group by tab_user_play_info.user_id) a ON a.user_id = tab_user.id "); } + if($gameplay){ + $user_count->join(" + (select user_id from tab_user_play where 1 $gameplay group by tab_user_play.user_id) a ON a.user_id = tab_user.id + "); + } if($promoterSelect){ $user_count->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1".$spendprom,"left"); }else{ @@ -187,6 +196,11 @@ class MemberController extends ThinkController (select user_id from tab_user_play_info where 1 $game_map group by tab_user_play_info.user_id) a ON a.user_id = tab_user.id "); } + if($gameplay){ + $user_count->join(" + (select user_id from tab_user_play where 1 $gameplay group by tab_user_play.user_id) a ON a.user_id = tab_user.id + "); + } $user_count = $user_count->find()['user_count']; //计算累计充值总额 $now_count = M("user","tab_") @@ -197,6 +211,11 @@ class MemberController extends ThinkController (select user_id from tab_user_play_info where 1 $game_map group by tab_user_play_info.user_id) a ON a.user_id = tab_user.id "); } + if($gameplay){ + $now_count->join(" + (select user_id from tab_user_play where 1 $gameplay group by tab_user_play.user_id) a ON a.user_id = tab_user.id + "); + } if($promoterSelect){ $now_count->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1".$spendprom,"left"); }else{ @@ -221,6 +240,11 @@ class MemberController extends ThinkController if($game_map){ $history_count->join("(select user_id from tab_user_play_info where 1 $game_map group by tab_user_play_info.user_id) a ON a.user_id = tab_user.id"); } + if($gameplay){ + $history_count->join(" + (select user_id from tab_user_play where 1 $gameplay group by tab_user_play.user_id) a ON a.user_id = tab_user.id + "); + } $history_count = $history_count->find()['recharge_total']; $this->assign('history_count', $history_count?:0); } diff --git a/Application/Admin/View/Member/user_info.html b/Application/Admin/View/Member/user_info.html index ec448a0ce..1249b6e9b 100644 --- a/Application/Admin/View/Member/user_info.html +++ b/Application/Admin/View/Member/user_info.html @@ -131,7 +131,7 @@
-
@@ -501,7 +501,7 @@ }); $("#promote_level").change(); }) - var game_server = "{:I('server_name')}"; + var game_server = "{:I('server_id')}"; $("#game_type").change(function(){ console.log({sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()}) $.ajax({ @@ -513,11 +513,11 @@ console.log(data) str = ""; for (var i in data){ - str += "" + str += "" } - $("#server_name").empty(); - $("#server_name").append(str); - $("#server_name").select2(); + $("#server_id").empty(); + $("#server_id").append(str); + $("#server_id").select2(); } }) });