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) {