From 123ee98c59a4dd0b1e180c1bf0babe4d88d37ad1 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Tue, 25 May 2021 14:44:06 +0800 Subject: [PATCH] =?UTF-8?q?5.26=E5=8A=9F=E8=83=BD=E4=B8=8A=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/RefundController.class.php | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/RefundController.class.php b/Application/Admin/Controller/RefundController.class.php index 4d0891d86..0ce1ec6ce 100644 --- a/Application/Admin/Controller/RefundController.class.php +++ b/Application/Admin/Controller/RefundController.class.php @@ -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"=>"退款金额" )); }