平台币导出bug修正

master
zyx 4 years ago
parent 8c0646d2a0
commit 223c69797c

@ -785,11 +785,26 @@ class TimingController extends AdminController {
CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE promote_id END promote_id,pay_way,market_admin_id") CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE promote_id END promote_id,pay_way,market_admin_id")
->join("left join tab_promote on tab_spend.promote_id = tab_promote.id") ->join("left join tab_promote on tab_spend.promote_id = tab_promote.id")
->join("left join tab_game game on game.id=tab_spend.game_id") ->join("left join tab_game game on game.id=tab_spend.game_id")
->where(['tab_spend.pay_status'=>1,'pay_way'=>['egt',0]]) ->where(['tab_spend.pay_status'=>1,'pay_way'=>['egt',1]])
->where($spend_map) ->where($spend_map)
->group("tab_spend.id") ->group("tab_spend.id")
->select(false); ->select(false);
// var_dump($spend);die();
$desposit = M("deposit","tab_")
->field("sum(pay_amount) as pay_amount,FROM_UNIXTIME(payed_time,'%Y-%m') pay_time,
substring_index(substring_index(tab_pay_info.game_name,'(',1),'(',-1) game_name,game_id,relation_game_id,tab_deposit.sdk_version,
CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE tab_pay_info.promote_id END promote_id,tab_deposit.pay_way,market_admin_id")
->join("inner join tab_pay_info on tab_pay_info.order_id=tab_deposit.pay_order_number")
->join("left join tab_promote on tab_deposit.promote_id = tab_promote.id")
->join("left join tab_game game on game.id=tab_pay_info.game_id")
->where(['tab_deposit.pay_status'=>1,'tab_deposit.pay_way'=>['egt',1],'pay_source'=>2])
->where($spend_map)
->group("tab_deposit.id")
->select(false);
$spend = "{$spend} UNION ALL {$desposit}";
// var_dump($desposit);die();
$payway_spend = M()->table("({$spend}) spend") $payway_spend = M()->table("({$spend}) spend")
->field("sum(pay_amount) as pay_amount,pay_time,promote_id,game_name,game_id,relation_game_id,pay_way,sdk_version") ->field("sum(pay_amount) as pay_amount,pay_time,promote_id,game_name,game_id,relation_game_id,pay_way,sdk_version")
->where($map) ->where($map)

Loading…
Cancel
Save