From 0472fe9cbc1f13d96a81c5b5971e2d6914a6b3d2 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Wed, 17 Jun 2020 11:42:48 +0800 Subject: [PATCH 1/3] upt --- Application/Admin/Controller/ExportController.class.php | 6 ++++-- Application/Admin/Controller/FinanceController.class.php | 6 ++++-- Application/Admin/View/Finance/payTypeStatistics.html | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index f0eac80a3..33dfaa804 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -1174,7 +1174,7 @@ class ExportController extends Controller $xlsCell = array( - "支付订单号","CP订单号", "充值时间","支付时间", "玩家账号", "游戏名称", L('Subordinate_channel'), "充值ip","区服ID", "游戏区服", + "支付订单号","CP订单号", "充值时间","支付时间", "玩家账号", "游戏名称", L('Subordinate_channel'), '所属推广公司', "充值ip","区服ID", "游戏区服", "角色ID","角色名称", "订单金额", "实付金额", "充值方式", L('Order_status'), "游戏通知状态", "消费"."{$total}" ); @@ -1206,7 +1206,9 @@ class ExportController extends Controller // ->join($tab_promote_join) // ->order('pay_time DESC') // ->select(); - ->field('pay_order_number,extend,pay_time,payed_time,user_account,game_name,promote_account,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') + ->field('pay_order_number,extend,pay_time,payed_time,user_account,game_name,promote_account, tab_promote_company.company_name, spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') + ->join('tab_promote on tab_promote.id = tab_spend.promote_id', 'left') + ->join('tab_promote_company on tab_promote_company.id and tab_promote.company_id', 'left') ->where($map) ->limit(($i-1)*$perSize ,$perSize) ->order($order ? $order : 'pay_time desc') diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 26a51e2db..87f9ff9e8 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -1220,6 +1220,7 @@ class FinanceController extends ThinkController } foreach ($cashStatistics as $key => $value) { + $cashStatistics[$key]['pay_rate'] = ''; $cashStatistics[$key]['total'] = $value['pay_amount'] + $value['balance'];//添加列表合计 } @@ -1236,11 +1237,12 @@ class FinanceController extends ThinkController foreach($cashStatistics as $key =>$value) { unset($cashStatistics[$key]['pay_way']); + $cashStatistics[$key]['pay_rate'] = strval(round($value['total']/$all_total, 4)*100) . "%"; } db2csv(array_merge($cashStatistics, - [0=>['pay_type'=>'总计','pay_amount'=>$all_pay_amount,'balance'=>$all_balance,'total'=>$all_total]]),'平台统计' - ,['支付方式','现金充值','平台币充值','合计']); + [0=>['pay_type'=>'总计','pay_amount'=>$all_pay_amount,'balance'=>$all_balance, 'pay_rate'=>'', 'total'=>$all_total]]),'平台统计' + ,['支付方式','现金充值','平台币充值', '支付方式占比', '合计']); } $this->checkListOrCountAuthRestMap($map,[]); diff --git a/Application/Admin/View/Finance/payTypeStatistics.html b/Application/Admin/View/Finance/payTypeStatistics.html index 65b6d0234..cd0cdce72 100644 --- a/Application/Admin/View/Finance/payTypeStatistics.html +++ b/Application/Admin/View/Finance/payTypeStatistics.html @@ -123,6 +123,7 @@ 充值方式 现金充值 平台币充值 + 充值方式占比 合计 @@ -144,6 +145,7 @@ 微信{$data.pay_type} {$data.pay_amount} {$data.balance}0 + % {$data.total}0 @@ -151,6 +153,7 @@ 总计 {$all_pay_amount}0 {$all_balance}0 + {$all_total}0 From 99fcc4cbbb118305839e73d47ed2903167cad5ef Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Thu, 18 Jun 2020 14:23:44 +0800 Subject: [PATCH 2/3] upt --- .../Admin/Controller/ExportController.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 33dfaa804..739fe1d30 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -1068,7 +1068,6 @@ class ExportController extends Controller ); break; case 7: - $startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart']; $endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend']; @@ -1206,15 +1205,20 @@ class ExportController extends Controller // ->join($tab_promote_join) // ->order('pay_time DESC') // ->select(); - ->field('pay_order_number,extend,pay_time,payed_time,user_account,game_name,promote_account, tab_promote_company.company_name, spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') - ->join('tab_promote on tab_promote.id = tab_spend.promote_id', 'left') - ->join('tab_promote_company on tab_promote_company.id and tab_promote.company_id', 'left') + ->field('pay_order_number,extend,pay_time,payed_time,user_account,game_name,promote_account, 0 as company_name, spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status, promote_id') + // ->join('tab_promote on tab_promote.id = tab_spend.promote_id', 'left') + // ->join('tab_promote_company on tab_promote_company.id and tab_promote.company_id', 'left') ->where($map) ->limit(($i-1)*$perSize ,$perSize) ->order($order ? $order : 'pay_time desc') ->select(); + $promoters = D('Promote')->where(['id'=>['in', array_unique(array_column($xlsData, 'promote_id'))]])->field('id, company_id')->select(); + $promoters = $promoters ? array_column($promoters, 'company_id', 'id') : []; + $companys = $promoters ? M('promote_company', 'tab_')->where(['id'=>['in', array_unique(array_values($promoters))]])->field('id, company_name')->select() : []; + $companys = $companys ? array_column($companys, 'company_name', 'id') : []; foreach($xlsData as $value) { + $value['company_name'] = $promoters[$value['promote_id']] == 0 ? '官方渠道' : ($companys[$promoters[$value['promote_id']]] ?? ''); $value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']); if($value['pay_status'] == 1) { $value['payed_time'] = date('Y-m-d H:i:s',$value['payed_time']); From e09296d10de474c978c4b8cd841cd33f21988873 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Fri, 19 Jun 2020 11:35:51 +0800 Subject: [PATCH 3/3] upt --- Application/Admin/Controller/ExportController.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 739fe1d30..7787d68a6 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -1219,6 +1219,7 @@ class ExportController extends Controller foreach($xlsData as $value) { $value['company_name'] = $promoters[$value['promote_id']] == 0 ? '官方渠道' : ($companys[$promoters[$value['promote_id']]] ?? ''); + unset($value['promote_id']); $value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']); if($value['pay_status'] == 1) { $value['payed_time'] = date('Y-m-d H:i:s',$value['payed_time']);