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