优化市场部毛利

master
chenzhi 4 years ago
parent 1b0124606a
commit df2da60986

@ -33,7 +33,7 @@ class MarketPercentageController extends ThinkController
// $_REQUEST['pay_time']?($map['pay_time'] = $_REQUEST['pay_time']):'';
$_REQUEST['promote_id']?($map['promote_id'] = $_REQUEST['promote_id']):'';
$_REQUEST['relation_game_id']?($map['relation_game_id'] = $_REQUEST['relation_game_id']):'';
$_REQUEST['sdk_version']?($map['sdk_version'] = $_REQUEST['sdk_version']):'';
// $_REQUEST['sdk_version']?($map['sdk_version'] = $_REQUEST['sdk_version']):'';
$_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):'';
($_REQUEST['company_id']||$_REQUEST['company_id']=='0')?($map['company_id'] = $_REQUEST['company_id']):'';
@ -103,11 +103,10 @@ class MarketPercentageController extends ThinkController
// dump($map);die();
// var_dump($map);die();
$data = M("settleup_marketorder","tab_")
->field("pay_time,promote_account,company_name,company_belong,member.real_name,develop_type,game_name,
$data = SM("settleup_marketorder","tab_")
->field("pay_time,promote_account,company_name,company_belong,real_name,develop_type,game_name,
sum(pay_amount) pay_amount,sum(cp_amount) cp_amount,sum(promote_amount) promote_amount,
sum(channel_amount) channel_amount, sum(company_tax) company_tax,sum(company_profit) company_profit")
->join("left join sys_member member on member.uid=admin_id");
sum(channel_amount) channel_amount, sum(company_tax) company_tax,sum(company_profit) company_profit");
if ($_REQUEST['export']) {
$data = $data->where($map)
@ -122,7 +121,7 @@ class MarketPercentageController extends ThinkController
->select();
}
$sum = M("settleup_marketorder","tab_")
$sum = SM("settleup_marketorder","tab_")
->field("pay_time,promote_account,company_belong,real_name,develop_type,game_name,
sum(pay_amount) pay_amount,sum(cp_amount) cp_amount,sum(promote_amount) promote_amount,
sum(channel_amount) channel_amount, sum(company_tax) company_tax,sum(company_profit) company_profit")
@ -186,12 +185,13 @@ class MarketPercentageController extends ThinkController
data2csv($data,'市场毛利统计',$title);
}
$count = M("settleup_marketorder","tab_")
$count = SM("settleup_marketorder","tab_")
->field("promote_id,game_name,pay_time,admin_id")
->where($map)
->group("promote_id,game_name,pay_time,admin_id")
->select(false);
$count = M()->table("({$count}) count")->count();
->select();
$count = count($count);
// $count = M()->table("({$count}) count")->count();
$page = set_pagination($count, $row);
if ($page) {

Loading…
Cancel
Save