From 0443871173f07aab1ac54a15b2205148c1d0c2a6 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 2 Mar 2020 14:13:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E9=87=8D=E5=A4=8D=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/MemberController.class.php | 53 ++++++++++++++++--- Application/Admin/View/Member/user_info.html | 9 ++-- 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index e72abb880..fdc499589 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -132,14 +132,12 @@ class MemberController extends ThinkController //计算用户列表 $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) - ->group("tab_user.id") + ->group("tab_user.id,device_number,tab_user.promote_id") // ->page($page, $row) ->order($order); - if(!isset($_REQUEST['export'])){ - $data ->page($page, $row); - } + if($havs){ $data->having($havs); } @@ -158,7 +156,50 @@ class MemberController extends ThinkController }else{ $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(); +// 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'])){ $isadmin = is_administrator(); //获取等级 @@ -309,7 +350,7 @@ class MemberController extends ThinkController $this->assign('user_count',$user_count); $this->assign('now_count', $now_count?:0); - $page = set_pagination($user_count, $row); + $page = set_pagination($user_count-$userRepeat, $row); if ($page) { $this->assign('_page', $page); } diff --git a/Application/Admin/View/Member/user_info.html b/Application/Admin/View/Member/user_info.html index 5b9d6eb37..4d78b4460 100644 --- a/Application/Admin/View/Member/user_info.html +++ b/Application/Admin/View/Member/user_info.html @@ -348,15 +348,18 @@ 当前用户累计充值:{$now_count}    历史累计充值:{$history_count}   - 用户数:{$user_count} + 用户数:{$user_count}   + 去充用户数:{$device_count} 当前用户累计充值: 当前属于该推广员的用户的充值累计(不含用户换绑前记录)  /   - 历史累计充值: 历史中属于该推广员的用户的充值累计(含用户换绑前记录) + 历史累计充值: 历史中属于该推广员的用户的充值累计(含用户换绑前记录)   + 去充用户数:{$device_count} - 当前用户累计充值:{$now_count}  用户数:{$user_count} + 当前用户累计充值:{$now_count}  用户数:{$user_count}   + 去充用户数:{$device_count}