|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|