diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index fe36f71ab..70b6c1cf6 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -2545,7 +2545,7 @@ class ExportController extends Controller $map['tp1.chain'] = '/'; } //为数据权限添加 - setPowerPromoteIds($map); + setPowerPromoteIds($map, 'u.promote_id'); $data = M('promote', 'tab_')->alias('tp1')->field('tp1.account as promote_account,tp1.id, date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(u.id) as count, count(IF(register_time ' . $today . ',1,null)) as today, count(IF(register_time ' . $week . ',1,null)) as week, @@ -2564,7 +2564,8 @@ class ExportController extends Controller $user_auth_promote_ids = session('user_auth_promote_ids'); if ($user_auth_promote_ids == 'all' || in_array('0', explode(",", $user_auth_promote_ids))) { //官方渠道数据添加 - $authorityData = M('user', 'tab_')->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, + $authorityData = M('user', 'tab_')->alias('u') + ->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, diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index f1c8843d5..0ccf54ea5 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -392,7 +392,7 @@ class PlatformController extends ThinkController } //为数据权限添加 - setPowerPromoteIds($map); + setPowerPromoteIds($map, 'u.promote_id'); $data = M('promote', 'tab_')->alias('tp1') ->field('tp1.account as promote_account,tp1.id, @@ -417,7 +417,8 @@ class PlatformController extends ThinkController $user_auth_promote_ids = session('user_auth_promote_ids'); if ($user_auth_promote_ids == 'all' || in_array('0', explode(",", $user_auth_promote_ids))) { //官方渠道数据添加 - $authorityData = M('user', 'tab_')->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, + $authorityData = M('user', 'tab_')->alias('u') + ->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,