|
|
|
@ -37,12 +37,12 @@ class MemberController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$order .= 'tab_user.id desc';
|
|
|
|
|
//条件筛选
|
|
|
|
|
//1条件筛选
|
|
|
|
|
$map = [];
|
|
|
|
|
$map['puid'] = array('eq', 0);
|
|
|
|
|
$map['is_platform'] = 0;
|
|
|
|
|
$havs=false;
|
|
|
|
|
//user表相关
|
|
|
|
|
//1.1 user表相关
|
|
|
|
|
if (isset($_REQUEST['user_id'])) {
|
|
|
|
|
$map['tab_user.id'] = $_REQUEST['user_id'];
|
|
|
|
|
}
|
|
|
|
@ -65,10 +65,15 @@ class MemberController extends ThinkController
|
|
|
|
|
if (isset($_REQUEST['viplevel'])) {
|
|
|
|
|
$havs = get_vip_level_limit('recharge_total', $_REQUEST['viplevel']);
|
|
|
|
|
}
|
|
|
|
|
//与游戏相关
|
|
|
|
|
$game = false;
|
|
|
|
|
|
|
|
|
|
//与推广员相关
|
|
|
|
|
//1.2 与游戏相关
|
|
|
|
|
$game_map = 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')) . ")";
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['server_name'])) {
|
|
|
|
|
$game_map = " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' ";
|
|
|
|
|
}
|
|
|
|
|
//1.3 与推广员相关
|
|
|
|
|
$promoterSelect = false;
|
|
|
|
|
if ($_REQUEST['promote_id'] != '') {
|
|
|
|
|
$promoterSelect = true;
|
|
|
|
@ -97,12 +102,18 @@ class MemberController extends ThinkController
|
|
|
|
|
if($havs){
|
|
|
|
|
$data->having($havs);
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
");
|
|
|
|
|
}
|
|
|
|
|
if($promoterSelect){
|
|
|
|
|
$data->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1".$spendprom,"left");
|
|
|
|
|
}else{
|
|
|
|
|
$data->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1","left");
|
|
|
|
|
}
|
|
|
|
|
$data = $data->select();
|
|
|
|
|
// echo($data);die();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//计算累计充值总额
|
|
|
|
@ -112,11 +123,17 @@ class MemberController extends ThinkController
|
|
|
|
|
if($havs){
|
|
|
|
|
$now_count->having($havs);
|
|
|
|
|
}
|
|
|
|
|
if($game_map){
|
|
|
|
|
$now_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($promoterSelect){
|
|
|
|
|
$now_count->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1".$spendprom,"left");
|
|
|
|
|
}else{
|
|
|
|
|
$now_count->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1","left");
|
|
|
|
|
}
|
|
|
|
|
// dump($now_count->select(false));die();
|
|
|
|
|
$now_count = $now_count->find()['recharge_total'];
|
|
|
|
|
|
|
|
|
|
//计算用户总数
|
|
|
|
@ -126,9 +143,14 @@ class MemberController extends ThinkController
|
|
|
|
|
if($havs){
|
|
|
|
|
$user_count->having($havs);
|
|
|
|
|
}
|
|
|
|
|
if($game_map){
|
|
|
|
|
$user_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
|
|
|
|
|
");
|
|
|
|
|
}
|
|
|
|
|
$user_count = $user_count->find()['user_count'];
|
|
|
|
|
|
|
|
|
|
//如股存在会长计算换绑定记录
|
|
|
|
|
//如果存在推广员只计算所属的推广员充值记录
|
|
|
|
|
if($promoterSelect){
|
|
|
|
|
$maps = $map;
|
|
|
|
|
unset($maps['tab_user.promote_id']);
|
|
|
|
@ -139,6 +161,9 @@ class MemberController extends ThinkController
|
|
|
|
|
if($havs){
|
|
|
|
|
$history_count->having($havs);
|
|
|
|
|
}
|
|
|
|
|
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");
|
|
|
|
|
}
|
|
|
|
|
$history_count = $history_count->find()['recharge_total'];
|
|
|
|
|
$this->assign('history_count', $history_count?:0);
|
|
|
|
|
}
|
|
|
|
|