|
|
|
@ -59,7 +59,7 @@ class RefundController extends ThinkController {
|
|
|
|
|
}
|
|
|
|
|
// dump($map);die();
|
|
|
|
|
$gameSql = M("game","tab_")
|
|
|
|
|
->field("tab_game.id game_id,partner")
|
|
|
|
|
->field("tab_game.id game_id,partner,relation_game_name")
|
|
|
|
|
->join("left join tab_partner on tab_game.partner_id=tab_partner.id")
|
|
|
|
|
->where("1=1")
|
|
|
|
|
->select(false);
|
|
|
|
@ -68,7 +68,7 @@ class RefundController extends ThinkController {
|
|
|
|
|
$model = SM("spend_refund",'tab_');
|
|
|
|
|
$data = $model
|
|
|
|
|
->field("tab_spend_refund.id,IFNULL(if(substring_index(substring_index(`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(`chain`,'/',2),'/',-1)),0) p_id,
|
|
|
|
|
s.`pay_time` pay_time,tab_spend_refund.user_id,tab_spend_refund.user_account,refund_amount,partner,game_name,company_name,promote.account,tab_spend_refund.status,admin,check_time")
|
|
|
|
|
s.`pay_time` pay_time,tab_spend_refund.user_id,tab_spend_refund.user_account,refund_amount,partner,relation_game_name game_name,company_name,promote.account,tab_spend_refund.status,admin,check_time")
|
|
|
|
|
->join("left join tab_spend s on tab_spend_refund.s_id=s.id")
|
|
|
|
|
->join("left join ({$gameSql}) g on s.game_id=g.game_id")
|
|
|
|
|
->join("tab_promote promote ON s.promote_id = promote.id","left")
|
|
|
|
@ -83,9 +83,27 @@ class RefundController extends ThinkController {
|
|
|
|
|
|
|
|
|
|
if(isset($_REQUEST['export'])){
|
|
|
|
|
$data = $data->field("a.id,CONCAT(' ',FROM_UNIXTIME(`pay_time`,'%Y-%m')) as month,user_id,user_account,sum(refund_amount) refund_amount,partner,game_name,company_name,pr.account top_account,a.status,admin,check_time")->select();
|
|
|
|
|
|
|
|
|
|
foreach ($data as $k => &$v) {
|
|
|
|
|
|
|
|
|
|
$status = $v['status']?'已退款':"未退款";
|
|
|
|
|
$time = date("Y-m-d H:i:s",$v['check_time']);
|
|
|
|
|
if ($v['status']) {
|
|
|
|
|
$v['check_detail'] = "{$status}({$v['admin']}){$time}";
|
|
|
|
|
} else {
|
|
|
|
|
$v['check_detail'] = "-----";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data2csv($data,'退款统计',array(
|
|
|
|
|
"month"=>"月份",
|
|
|
|
|
"partner"=>"上游cp",
|
|
|
|
|
"game_name"=>"游戏",
|
|
|
|
|
"user_account"=>"玩家账号",
|
|
|
|
|
"company_name"=>"工会名称",
|
|
|
|
|
"top_account"=>"会长账号",
|
|
|
|
|
"check_detail"=>"退款状态",
|
|
|
|
|
"refund_amount"=>"退款金额"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|