From 6b1bbe4c200af8110a01e4fe0337996197bdeb89 Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Mon, 16 Dec 2019 10:44:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=88=E6=9D=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 42 +++++++++++++------ .../Controller/PublicController.class.php | 1 + 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 1f7ac555d..4b722eef7 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -541,9 +541,16 @@ class PromoteController extends ThinkController 'title' => '渠道注册', 'template_list' =>'ch_reg_list', ); - $total=D($model['m_name'])->join('tab_promote ON tab_user.promote_id = tab_promote.id')->where(array('tab_user.promote_id'=>array('neq',0),'puid'=>0))->count(); - $ttotal=D($model['m_name'])->join('tab_promote ON tab_user.promote_id = tab_promote.id')->where('register_time'.total(1))->where(array('tab_user.promote_id'=>array('neq',0),'puid'=>0))->count(); - $ytotal=D($model['m_name'])->join('tab_promote ON tab_user.promote_id = tab_promote.id')->where('register_time'.total(5))->where(array('tab_user.promote_id'=>array('neq',0),'puid'=>0))->count(); + $map1 = array('tab_user.promote_id'=>array('neq',0),'puid'=>0); + $map2['register_time'] = total(1, false); + $map3['register_time'] = total(5, false); + //为数据权限添加 + setPowerPromoteIds($map1); + setPowerPromoteIds($map2); + setPowerPromoteIds($map3); + $total = D($model['m_name'])->join('tab_promote ON tab_user.promote_id = tab_promote.id')->where($map1)->count(); + $ttotal=D($model['m_name'])->join('tab_promote ON tab_user.promote_id = tab_promote.id')->where($map2)->where(array('tab_user.promote_id'=>array('neq',0),'puid'=>0))->count(); + $ytotal=D($model['m_name'])->join('tab_promote ON tab_user.promote_id = tab_promote.id')->where($map3)->where(array('tab_user.promote_id'=>array('neq',0),'puid'=>0))->count(); $this->assign('total', $total); $this->assign('ttotal', $ttotal); $this->assign('ytotal', $ytotal); @@ -670,11 +677,19 @@ class PromoteController extends ThinkController 'title' => '渠道充值', 'template_list' =>'spend_list', ); - $map1=$map; + $map1 = $map; $map1['pay_status']=1; - $total =null_to_0(D('Spend')->where($map1)->sum('pay_amount')); - $ttotal=null_to_0(D('Spend')->where('pay_time'.total(1))->where(array('pay_status'=>1))->where(array('promote_id'=>array("gt",0)))->sum('pay_amount')); - $ytotal=null_to_0(D('Spend')->where('pay_time'.total(5))->where(array('pay_status'=>1))->where(array('promote_id'=>array("gt",0)))->sum('pay_amount')); + + $map2 = [ + 'pay_status' => 1, + 'promote_id' => ["gt", 0], + ]; + //为数据权限添加 + setPowerPromoteIds($map2); + $total = null_to_0(D('Spend')->where($map1)->sum('pay_amount')); + $ttotal = null_to_0(D('Spend')->where('pay_time'.total(1))->where($map2)->sum('pay_amount')); + $ytotal = null_to_0(D('Spend')->where('pay_time'.total(5))->where($map2)->sum('pay_amount')); + $this->assign('total', $total); $this->assign('ttotal', $ttotal); $this->assign('ytotal', $ytotal); @@ -744,11 +759,14 @@ class PromoteController extends ThinkController //为数据权限添加 setPowerPromoteIds($map); - $map1=$map; - $map1['pay_status']=1; - $total=D('Agent')->field('sum(amount) amount,sum(real_amount) real_amount')->where($map1)->find(); - $ttotal=D('Agent')->field('sum(amount) amount,sum(real_amount) real_amount')->where('create_time'.total(1))->where(array('pay_status'=>1))->find(); - $ytotal=D('Agent')->field('sum(amount) amount,sum(real_amount) real_amount')->where('create_time'.total(5))->where(array('pay_status'=>1))->find(); + $map1 = $map; + $map1['pay_status'] = 1; + + $map2 = array('pay_status'=>1); + setPowerPromoteIds($map2); + $total = D('Agent')->field('sum(amount) amount,sum(real_amount) real_amount')->where($map1)->find(); + $ttotal = D('Agent')->field('sum(amount) amount,sum(real_amount) real_amount')->where('create_time'.total(1))->where($map2)->find(); + $ytotal = D('Agent')->field('sum(amount) amount,sum(real_amount) real_amount')->where('create_time'.total(5))->where($map2)->find(); $this->assign('total', $total); $this->assign('ttotal', $ttotal); $this->assign('ytotal', $ytotal); diff --git a/Application/Admin/Controller/PublicController.class.php b/Application/Admin/Controller/PublicController.class.php index fd7241523..82fbdac37 100644 --- a/Application/Admin/Controller/PublicController.class.php +++ b/Application/Admin/Controller/PublicController.class.php @@ -75,6 +75,7 @@ class PublicController extends \Think\Controller if (is_login()) { D('Member')->logout(); session('[destroy]'); + session('user_auth_promote_ids'); cookie('think_language', Null); // $this->success('退出成功!', U('login')); $this->ajaxReturn(array('status' => 1, 'msg' => '退出成功!'));