From 9064fc7c584a95396081ed487b8c032767c032ca Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 20 Mar 2020 17:08:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=BB=9F=E8=AE=A1=20?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=90=8D=E7=A7=B0=E4=B8=8D=E5=90=AB=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=B1=BB=E5=9E=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/function.php | 5 ++ .../Controller/ExportController.class.php | 5 +- .../Controller/FinanceController.class.php | 71 +++++++++++++++++-- .../Admin/View/Finance/coinDetail.html | 15 ++-- .../View/Finance/gameStatisticsDetail.html | 13 +--- 5 files changed, 80 insertions(+), 29 deletions(-) diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index 1642dc963..4a6b153e6 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -886,3 +886,8 @@ function getSDKTypeName($sdkType, $chinese = false) return $sdkName; } +//游戏名称取消 (安卓版),(苹果版) +function clearGameNameType($game_name) +{ + return preg_replace("/\(.*\)/","",$game_name); +} diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index ee3230158..eba9d5083 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -8010,6 +8010,7 @@ class ExportController extends Controller array('pay_time','充值时间'), array('user_account','玩家账号'), array('game_name','游戏名称'), + array('sdk_version','设备名称'), array('server_name','游戏区服'), array('game_player_name','角色名称'), array('cost','订单金额'), @@ -8074,7 +8075,7 @@ class ExportController extends Controller $map['tab_spend.game_player_name'] = array('like',I("user_nickname").'%'); } $field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,tab_spend.user_account, - tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name, + tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name,tab_spend.sdk_version, game_player_name,pay_amount,cost,pay_way"; $group = ""; $order = "pay_time DESC"; @@ -8096,6 +8097,8 @@ class ExportController extends Controller foreach($xlsData as $key => $value) { $xlsData[$key]['pay_way'] = getPayType($value['pay_way']); + $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); + $xlsData[$key]['sdk_version'] =$xlsData[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; } $map['pay_game_status'] = 1; diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index dc7d416da..f5403389f 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -836,14 +836,41 @@ class FinanceController extends ThinkController $map['game_player_name'] = array('like',I("user_nickname").'%'); } // var_dump($map);die(); - $field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way"; + $field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,sdk_version"; $group = ""; $order = "pay_time DESC"; - $data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row); + if(isset($_REQUEST['export'])){ + $data = D('spend')->getSpendData($map,$field,$group,0,0,$row); + }else{ + $data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row); + } foreach($data as $key => $value) { $data[$key]['pay_way'] = getPayType($value['pay_way']); + $data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; + $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); + } + if(isset($_REQUEST['export'])){ + //操作日志 + $GetData = $_GET; + unset($GetData['export']); + $dcop = array( + "pay_order_number"=>"支付订单号", + "pay_time"=>"充值时间", + "user_account"=>"玩家账号", + "game_name"=>"游戏名称", + "sdk_version"=>"设备类型", + "promote_account"=>"所属推广员", + "spend_ip"=>"充值ip", + "server_name"=>"游戏区服", + "game_player_name"=>"角色名称", + "cost"=>"订单金额", + "pay_amount"=>"实付金额", + "pay_way"=>"充值方式" + ); + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"充值-财务管理-游戏统计-订单查看-导出"]); + data2csv($data,"游戏统计订单查看",$dcop); } $totalData = D('spend')->totalGameStatistics($map, false); @@ -937,7 +964,7 @@ class FinanceController extends ThinkController } // var_dump($map);die(); $field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,tab_spend.user_account, - tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name, + tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name,tab_spend.sdk_version, game_player_name,pay_amount,cost,pay_way"; $group = ""; $order = "pay_time DESC"; @@ -949,16 +976,46 @@ class FinanceController extends ThinkController $field2 = $field . ',balance'; $join = 'left join tab_user as u on u.id = tab_spend.user_id'; } - - $data = D('spend')->getSpendData($map, $field2, $group, $order, $page, $row, $join); - + + if(isset($_REQUEST['export'])){ + $data = D('spend')->getSpendData($map, $field2, $group, $order, 0, 0, $join); + }else{ + $data = D('spend')->getSpendData($map, $field2, $group, $order, $page, $row, $join); + } foreach($data as $key => $value) { $data[$key]['pay_way'] = getPayType($value['pay_way']); - + $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); + $data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; $data[$key]['cost'] = number_format($value['cost'],2,'.',''); $data[$key]['pay_amount'] = number_format($value['pay_amount'],2,'.',''); } + if(isset($_REQUEST['export'])){ + //操作日志 + $GetData = $_GET; + unset($GetData['export']); + $dcop = array( + "pay_order_number"=>"支付订单号", + "pay_time"=>"充值时间", + "user_account"=>"玩家账号", + "game_name"=>"游戏名称", + "sdk_version"=>"设备名称", + "server_name"=>"游戏区服", + "game_player_name"=>"角色名称", + "cost"=>"订单金额", + "pay_amount"=>"实付金额", + "pay_way"=>"充值方式" + ); + if ($map['pay_way'] ==-1) { + $title = "内充支出明细"; + $dcop["bind_balance"]="绑定币余额"; + } elseif ($map['pay_way'] ==0) {//平台币 + $title = "平台币直充明细"; + $dcop["balance"]="平台币余额"; + } + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"充值-财务管理-游戏统计-{$title}-导出"]); + data2csv($data,$title,$dcop); + } $count = D("spend")->getSpendData($map,$field,$group,$order); $count = count($count); $page = set_pagination($count,$row); diff --git a/Application/Admin/View/Finance/coinDetail.html b/Application/Admin/View/Finance/coinDetail.html index d9ba26176..1b8a7e8bd 100644 --- a/Application/Admin/View/Finance/coinDetail.html +++ b/Application/Admin/View/Finance/coinDetail.html @@ -50,16 +50,7 @@ 搜索 - 导出 + 导出 @@ -76,6 +67,7 @@ 充值时间 玩家账号 游戏名称 + 设备名称 游戏区服 角色名称 订单金额 @@ -94,6 +86,7 @@ {$data.pay_time} {$data.user_account} {$data.game_name} + {$data.sdk_version} {$data.server_name} {$data.game_player_name} {$data.cost} @@ -108,7 +101,7 @@ - 总计 + 总计 {$total_cost}0.00 {$total_pay_amount}0.00 diff --git a/Application/Admin/View/Finance/gameStatisticsDetail.html b/Application/Admin/View/Finance/gameStatisticsDetail.html index 67a583667..57681aea9 100644 --- a/Application/Admin/View/Finance/gameStatisticsDetail.html +++ b/Application/Admin/View/Finance/gameStatisticsDetail.html @@ -93,16 +93,7 @@ 搜索 - 导出 + 导出 @@ -123,6 +114,7 @@ 玩家账号 游戏名称 + 设备类型 所属推广员 @@ -158,6 +150,7 @@ {$data.pay_time} {$data.user_account} {$data.game_name} + {$data.sdk_version} {$data.promote_account} {$data.spend_ip} {$data.server_name}