From 0b2eb4a45b0f7ee4e6d0ecbb1abba4c17015996e Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Wed, 18 Dec 2019 15:06:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0-=E3=80=8B?= =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E7=BB=9F=E8=AE=A1-=E3=80=8B?= =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E6=B3=A8=E5=86=8C=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E4=B8=8E?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=9D=83=E9=99=90=20=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=90=8E=E5=8F=B0-=E3=80=8B=E6=8E=A8=E5=B9=BF=E5=91=98?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1-=E3=80=8B=E6=8E=A8=E5=B9=BF=E5=91=98?= =?UTF-8?q?=E5=85=85=E5=80=BC=E7=BB=9F=E8=AE=A1=E5=88=97=E8=A1=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9D=83=E9=99=90=E4=B8=8E=E5=AF=BC=E5=87=BA=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ExportController.class.php | 17 +++++++++-------- .../Controller/PlatformController.class.php | 18 +++++++++++++----- 2 files changed, 22 insertions(+), 13 deletions(-) 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();