@ -132,14 +132,12 @@ class MemberController extends ThinkController
//计算用户列表
//计算用户列表
$data = M("user","tab_")
$data = M("user","tab_")
->field("tab_user.id,`device_number`,`age_status`,`account`,`balance`,`gold_coin`,`alipay`,tab_user.promote_id,`register_type`,tab_user.promote_account,`register_time`,`lock_status`,lock_remark,`register_way`,`register_ip`,`login_time`,`check_status`,IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
->field("tab_user.id,`device_number`,count(`device_number`) as device_count, `age_status`,`account`,`balance`,`gold_coin`,`alipay`,tab_user.promote_id,`register_type`,tab_user.promote_account,`register_time`,`lock_status`,lock_remark,`register_way`,`register_ip`,`login_time`,`check_status`,IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
->where($map)
->where($map)
->group("tab_user.id")
->group("tab_user.id,device_number,tab_user.promote_id ")
// ->page($page, $row)
// ->page($page, $row)
->order($order);
->order($order);
if(!isset($_REQUEST['export'])){
$data ->page($page, $row);
}
if($havs){
if($havs){
$data->having($havs);
$data->having($havs);
}
}
@ -158,7 +156,50 @@ class MemberController extends ThinkController
}else{
}else{
$data->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1","left");
$data->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1","left");
}
}
$data = $data->select(false);
$data = M()->table('(' . $data . ') as a ')->where(['device_count'=>['elt',1]]);
if(!isset($_REQUEST['export'])){
$data ->page($page, $row);
}
$data = $data->select();
$data = $data->select();
// var_dump($data);die();
//计算用户列表重复数量
$userRepeat = M("user","tab_")
->field("count(`device_number`) as device_count")
->where($map)
->group("tab_user.id,device_number,tab_user.promote_id")
// ->page($page, $row)
->order($order);
if($havs){
$userRepeat->having($havs);
}
if($gameplay){
$userRepeat->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){
$userRepeat->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){
$userRepeat->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1".$spendprom,"left");
}else{
$userRepeat->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1","left");
}
$userRepeat = $userRepeat->select(false);
$userRepeat = M()->table('(' . $userRepeat . ') as a ')->where(['device_count'=>['gt',1]])->count();
$this->assign('device_count',$userRepeat);
if(isset($_REQUEST['export'])){
if(isset($_REQUEST['export'])){
$isadmin = is_administrator();
$isadmin = is_administrator();
//获取等级
//获取等级
@ -309,7 +350,7 @@ class MemberController extends ThinkController
$this->assign('user_count',$user_count);
$this->assign('user_count',$user_count);
$this->assign('now_count', $now_count?:0);
$this->assign('now_count', $now_count?:0);
$page = set_pagination($user_count, $row);
$page = set_pagination($user_count-$userRepeat , $row);
if ($page) {
if ($page) {
$this->assign('_page', $page);
$this->assign('_page', $page);
}
}