From 14bb68b82e2c9e8905fac16fc5d6165512404ad9 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 30 Dec 2020 19:50:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=9A=E7=BB=A9=E6=8F=90?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MarketPercentageController.class.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index b02fecdc1..20fd27c4a 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -565,6 +565,8 @@ class MarketPercentageController extends ThinkController $map = []; $map['group_id'] = ['in','11,12,21']; + //获取权限 + $marketPercentage = M("auth_group")->where($map)->getField("id,market_percentage"); // $_REQUEST['pay_time']?($map['pay_time'] = $_REQUEST['pay_time']):''; $_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):''; @@ -654,28 +656,24 @@ class MarketPercentageController extends ThinkController $this->assign('start_time',$start_time); $this->assign('end_time',$end_time); - $data = M("market_altogether","tab_") + $data = SM("market_altogether","tab_") ->where($map); if ($_REQUEST['export']) { $data = $data - ->field("tab_market_altogether.*,market_percentage") - ->join("left join sys_auth_group_access access on tab_market_altogether.admin_id = access.uid") - ->join("left join sys_auth_group auth on access.group_id=auth.id") + ->field("*") ->order("pay_time DESC,company_profit DESC") ->select(); } else { $data = $data - ->field("tab_market_altogether.*,market_percentage") - ->join("left join sys_auth_group_access access on tab_market_altogether.admin_id = access.uid") - ->join("left join sys_auth_group auth on access.group_id=auth.id") + ->field("*") // ->page($p, $row) ->order("pay_time DESC,company_profit DESC") ->select(); } - $count = M("market_altogether","tab_") + $count = SM("market_altogether","tab_") ->where($map) ->count(); @@ -701,7 +699,7 @@ class MarketPercentageController extends ThinkController $this->assign('coefficient_in_check',$this->checkRule($exportRule,array('in','1,2'))); } - $all_data = M("market_altogether","tab_") + $all_data = SM("market_altogether","tab_") // ->where($map) ->select(); $wait_amount = []; @@ -722,6 +720,10 @@ class MarketPercentageController extends ThinkController $admin = $_SESSION['onethink_admin']['user_auth']['username']; foreach ($data as $key => $value) { + $level = $value['level']; + if(isset($marketPercentage[$level])){ + $value['market_percentage'] = $marketPercentage[$level]; + } $Rule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_export_show_check"); if ($_REQUEST['export'] && $this->checkRule($Rule,array('in','1,2'))) {