sum(performance_commission) performance_commission,sum(achievement_bonus* IF(coefficient is not NULL, coefficient, 100)/100) achievement_bonus,
sum(performance_commission) performance_commission,IF(leave_time!=0 and unix_timestamp(now())-leave_time>86400*30,0,sum(achievement_bonus* IF(coefficient is not NULL, coefficient, 100)/100)) achievement_bonus,
sum(if(status > 0, wait_performance_commission, '0.00')) + sum(if(status > 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100 ) wait_extend_commission,
sum(if(status = 0, wait_performance_commission, '0.00')) + round(sum(if(status = 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100),2) wait_commission, remark,status")
sum(if(tab_market_altogether.status > 0, wait_performance_commission, '0.00')) + sum(if(tab_market_altogether.status > 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100 ) wait_extend_commission,
sum(if(tab_market_altogether.status = 0, wait_performance_commission, '0.00')) + round(sum(if(tab_market_altogether.status = 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100),2) wait_commission, remark,tab_market_altogether.status")
->where($map);
if ($_REQUEST['export']) {
$data = $data
->join("left join tab_coefficient on tab_market_altogether.admin_id=tab_coefficient.admin_id and tab_coefficient.pay_time=tab_market_altogether.pay_time")
->join("left join sys_ucenter_member on tab_market_altogether.admin_id=sys_ucenter_member.id")
@ -1437,6 +1440,7 @@ class MarketPercentageController extends ThinkController
$data = $data
// ->page($p, $row)
->join("left join tab_coefficient on tab_market_altogether.admin_id=tab_coefficient.admin_id and tab_coefficient.pay_time=tab_market_altogether.pay_time")
->join("left join sys_ucenter_member on tab_market_altogether.admin_id=sys_ucenter_member.id")