diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 1b91e0c76..a1a825d97 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -2492,7 +2492,8 @@ class ExportController extends Controller } else { $map['tp1.chain'] = '/'; } - + //为数据权限添加 + setPowerPromoteIds($map); $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, @@ -2586,10 +2587,7 @@ class ExportController extends Controller } private function promotepay_statistics_export($p=0){ - $page = intval($p); - $page = $page ? $page : 1; //默认显示第一页数据 - $arraypage=$page; - $row = 10; + $map1['promote_id'] = $map['promote_id'] = array('egt', 0); $spend=M('Spend','tab_'); if(isset($_REQUEST['timestart'])&&isset($_REQUEST['timeend'])){ @@ -2627,9 +2625,12 @@ class ExportController extends Controller if (isset($_REQUEST['promote_id'])) { $promote_map = "`chain` = '%/{$_REQUEST['promote_id']}/%' OR id = {$_REQUEST['promote_id']}"; } - - $promote = M("promote","tab_")->field("id,account")->page($page,$row)->where($promote_map)->select(); - $pcount = M("promote","tab_")->field("count(*) acount")->where($promote_map)->find()['acount']; + //为数据权限添加 + setPowerPromoteIds($map); + $promote_map2 = array(); + setPowerPromoteIds($promote_map2, 'id'); + $promote = M("promote","tab_")->field("id,account")->where($promote_map)->where($promote_map2)->select(); + $pcount = M("promote","tab_")->field("count(*) acount")->where($promote_map)->where($promote_map2)->find()['acount']; // var_dump( $promote); $data =array(); diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 888c8dc7c..3afc226e2 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -393,8 +393,13 @@ class PlatformController extends ThinkController $map['tp1.chain'] = '/'; } + //为数据权限添加 + setPowerPromoteIds($map); - $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, + $data = M('promote', 'tab_')->alias('tp1') + ->field('tp1.account as promote_account,tp1.id, + date_format(FROM_UNIXTIME(register_time),"% ") 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, count(IF(register_time ' . $mounth . ',1,null)) as mounth') @@ -458,7 +463,7 @@ class PlatformController extends ThinkController $this->display(); } //TODO: - function promotepay_statistics($p = 0) + public function promotepay_statistics($p = 0) { $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 @@ -497,9 +502,12 @@ class PlatformController extends ThinkController if (isset($_REQUEST['promote_id'])) { $promote_map = "`chain` = '%/{$_REQUEST['promote_id']}/%' OR id = {$_REQUEST['promote_id']}"; } - - $promote = M("promote","tab_")->field("id,account")->page($page,$row)->where($promote_map)->select(); - $pcount = M("promote","tab_")->field("count(*) acount")->where($promote_map)->find()['acount']; + //为数据权限添加 + setPowerPromoteIds($map); + $promote_map2 = array(); + setPowerPromoteIds($promote_map2, 'id'); + $promote = M("promote","tab_")->field("id,account")->page($page,$row)->where($promote_map)->where($promote_map2)->select(); + $pcount = M("promote","tab_")->field("count(*) acount")->where($promote_map)->where($promote_map2)->find()['acount']; // var_dump( $promote); $data =array();