From 8bb10aea61a2d31bffd71ace4039ed7210800071 Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Mon, 25 Nov 2019 10:52:10 +0800 Subject: [PATCH] =?UTF-8?q?[bug]=E7=8E=A9=E5=AE=B6=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E5=85=85=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/MemberController.class.php | 11 +++++++---- Application/Admin/View/Member/user_info.html | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 01c9b978d..0d6029bf6 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -219,9 +219,11 @@ class MemberController extends ThinkController ->group('tab_user.id') ->where($hav) ->having($havs)->select(false); + + $allcountsql = str_replace("tab_user.promote_id","ss.promote_id",$sql); //获取总额 - $allcount = M()->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select(); - $this->assign('history_count', $allcount[0]['recharge_total']); + $allcount = M()->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $allcountsql . ') as a')->select(); + $this->assign('history_count', $allcount[0]['recharge_total']?:0); //替换为新表 if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){ @@ -236,9 +238,10 @@ class MemberController extends ThinkController } $jcount = M('User', 'tab_')->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select(); - $count = $jcount[0]['count']; + $count = $jcount[0]['count'] ?:0 ; + $this->assign('user_count', $count); // var_dump($jcount);die(); - $this->assign('now_count', $jcount[0]['recharge_total']); + $this->assign('now_count', $jcount[0]['recharge_total']?:0); $model = M('Model')->getByName('user'); diff --git a/Application/Admin/View/Member/user_info.html b/Application/Admin/View/Member/user_info.html index 3111dcb7f..3faaa8021 100644 --- a/Application/Admin/View/Member/user_info.html +++ b/Application/Admin/View/Member/user_info.html @@ -310,7 +310,8 @@ 当前用户累计充值:{$now_count}    - 历史累计充值:{$history_count} + 历史累计充值:{$history_count}   + 用户数:{$user_count} 当前用户累计充值: 当前属于该推广员的用户的充值累计(不含用户换绑前记录)  /   @@ -318,7 +319,7 @@ - 当前用户累计充值:{$now_count} + 当前用户累计充值:{$now_count}  用户数:{$user_count}