From 126d1ca9bc35a8e077914ebd421fbd5759a5bb14 Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Fri, 20 Dec 2019 11:47:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0-=E3=80=8B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1-=E3=80=8B=E6=8E=A8=E5=B9=BF=E5=91=98?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=AE=A1=E7=90=86=E5=91=98=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=9C=89=E5=AE=98=E6=96=B9=E6=B8=A0=E9=81=93=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/ExportController.class.php | 12 ++++++++---- .../Admin/Controller/PlatformController.class.php | 13 +++++++++---- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 15ba5d902..7d104feaa 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -2560,13 +2560,17 @@ class ExportController extends Controller unset($map['tp1.id']); unset($map['tp1.chain']); $map['promote_id'] = 0; - //官方渠道数据添加 - $authorityData = M('user', 'tab_')->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(id) as count, + //如果有官方渠道权限 + if (in_array('0', explode(",", session('user_auth_promote_ids')))) { + //官方渠道数据添加 + $authorityData = M('user', 'tab_')->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, + count(id) as count, count(IF(register_time ' . $today . ',1,null)) as today, count(IF(register_time ' . $week . ',1,null)) as week, count(IF(register_time ' . $mounth . ',1,null)) as mounth') - ->where($map) - ->find(); + ->where($map) + ->find(); + } $authorityData['promote_account'] = "官方渠道"; $authorityData['id'] = "1"; if (isset($_REQUEST['promote_id'])||$authorityData['count']==0) { diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 3afc226e2..2bc2b1867 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -413,13 +413,18 @@ class PlatformController extends ThinkController unset($map['tp1.id']); unset($map['tp1.chain']); $map['promote_id'] = 0; - //官方渠道数据添加 - $authorityData = M('user', 'tab_')->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(id) as count, + $authorityData['count'] = 0; + //如果有官方渠道权限 + if (in_array('0', explode(",", session('user_auth_promote_ids')))) { + //官方渠道数据添加 + $authorityData = M('user', 'tab_')->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, + count(id) as count, count(IF(register_time ' . $today . ',1,null)) as today, count(IF(register_time ' . $week . ',1,null)) as week, count(IF(register_time ' . $mounth . ',1,null)) as mounth') - ->where($map) - ->find(); + ->where($map) + ->find(); + } $authorityData['promote_account'] = "官方渠道"; $authorityData['id'] = "1"; if (isset($_REQUEST['promote_id'])||$authorityData['count']==0) {