优化业绩提成

master
chenzhi 4 years ago
parent df2da60986
commit 14bb68b82e

@ -565,6 +565,8 @@ class MarketPercentageController extends ThinkController
$map = []; $map = [];
$map['group_id'] = ['in','11,12,21']; $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['pay_time']?($map['pay_time'] = $_REQUEST['pay_time']):'';
$_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):''; $_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('start_time',$start_time);
$this->assign('end_time',$end_time); $this->assign('end_time',$end_time);
$data = M("market_altogether","tab_") $data = SM("market_altogether","tab_")
->where($map); ->where($map);
if ($_REQUEST['export']) { if ($_REQUEST['export']) {
$data = $data $data = $data
->field("tab_market_altogether.*,market_percentage") ->field("*")
->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")
->order("pay_time DESC,company_profit DESC") ->order("pay_time DESC,company_profit DESC")
->select(); ->select();
} else { } else {
$data = $data $data = $data
->field("tab_market_altogether.*,market_percentage") ->field("*")
->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")
// ->page($p, $row) // ->page($p, $row)
->order("pay_time DESC,company_profit DESC") ->order("pay_time DESC,company_profit DESC")
->select(); ->select();
} }
$count = M("market_altogether","tab_") $count = SM("market_altogether","tab_")
->where($map) ->where($map)
->count(); ->count();
@ -701,7 +699,7 @@ class MarketPercentageController extends ThinkController
$this->assign('coefficient_in_check',$this->checkRule($exportRule,array('in','1,2'))); $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) // ->where($map)
->select(); ->select();
$wait_amount = []; $wait_amount = [];
@ -722,6 +720,10 @@ class MarketPercentageController extends ThinkController
$admin = $_SESSION['onethink_admin']['user_auth']['username']; $admin = $_SESSION['onethink_admin']['user_auth']['username'];
foreach ($data as $key => $value) { 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"); $Rule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_export_show_check");
if ($_REQUEST['export'] && $this->checkRule($Rule,array('in','1,2'))) { if ($_REQUEST['export'] && $this->checkRule($Rule,array('in','1,2'))) {

Loading…
Cancel
Save