优化新增条件

master
chenzhi 4 years ago
parent c5bc599289
commit 382f2527a0

@ -834,7 +834,7 @@ class TimingController extends AdminController {
$amount_time['tab_spend.pay_status'] = 1;
$amount_time['pay_way'] = ['egt',0];
$amount_time['_string'] = "payed_time between {$statement_begin_time} and {$statement_end_time} and relation_game_id={$v['relation_game_id']}";
D("Spend")->addSubsiteWhere($amount_time);
$dataAmount = M("spend","tab_")
->field("pay_amount,relation_game_id,relation_game_name,payed_time,game_type_name,substring_index(substring_index(promote.`chain`,'/',2),'/',-1) promote_id,chain,admin_id")
->join("left join tab_promote promote on tab_spend.promote_id=promote.id")
@ -974,7 +974,7 @@ class TimingController extends AdminController {
public function getSpendData($begintime = 0,$endtime = 0,$company_id=0,$relation_game_id=0,$admin_id=0,$promote_id=0) {
$map['tab_spend.pay_status'] = 1;
$map['pay_way'] = ['egt',0];
D("Spend")->addSubsiteWhere($map,"tab_spend");
$spend = M("spend","tab_")
->field("sum(pay_amount) pay_amount,
CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE promote_id END promote_id,game.relation_game_id,company_id")
@ -1030,7 +1030,7 @@ class TimingController extends AdminController {
}
if ($map['pay_time']) {
M("settleup_marketorder","tab_")
SM("settleup_marketorder","tab_")
->where(['pay_time'=>['in',$month_time]])
->delete();
}
@ -1086,7 +1086,7 @@ class TimingController extends AdminController {
if (!$spend_map['_string']) {
$spend_map['_string'] = "relation_game_id = 0";
}
D("Spend")->addSubsiteWhere($spend_map,"tab_spend");
$spend = M("spend","tab_")
->field("sum(pay_amount) as pay_amount,FROM_UNIXTIME(pay_time,'%Y-%m') pay_time,
substring_index(substring_index(tab_spend.game_name,'(',1),'(',-1) game_name,game_id,relation_game_id,tab_spend.sdk_version,
@ -1108,7 +1108,7 @@ class TimingController extends AdminController {
->select(false);
$unsettlement['_string'] = "tab_spend.id not in($not_in_spend)";
D("Spend")->addSubsiteWhere($unsettlement,"tab_spend");
$unsettlement_spend = M("spend","tab_")
->field("sum(pay_amount) as pay_amount,FROM_UNIXTIME(pay_time,'%Y-%m') pay_time,
substring_index(substring_index(tab_spend.game_name,'(',1),'(',-1) game_name,game_id,relation_game_id,tab_spend.sdk_version,

Loading…
Cancel
Save