From 2651a94408d14faa3c970ae7bec95382c8322c48 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Sat, 21 Dec 2019 11:48:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E5=AF=BC=E5=87=BA2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinancePromoteController.class.php | 94 +++++++++++++++++-- .../View/FinancePromote/gameCoinDetail.html | 14 +-- .../View/FinancePromote/gameStatistics.html | 30 ++---- .../FinancePromote/gameStatisticsDetail.html | 16 +--- .../View/FinancePromote/promoteUser.html | 4 +- 5 files changed, 99 insertions(+), 59 deletions(-) diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index a868eee70..96b8286b2 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -92,7 +92,7 @@ class FinancePromoteController extends AdminController "bind_coin_count"=>"内充支出", "inside_cash_count"=>"平台币内充", "allcount"=>"渠道游戏内充值合计" - ));die(); + )); } $this->assign('list_data', $data); $this->assign('all_count', $count); @@ -235,10 +235,22 @@ class FinancePromoteController extends AdminController } $data = my_sort($data, $data_order_type, (int)$data_order); + if(isset($_REQUEST['export'])){ + data2csv($data,'渠道统计',array( + "company_name"=>"推广公司", + "promote_account"=>"推广员账号", + "cash_count"=>"游戏现金金额", + "balance_coin_count"=>"平台币直充支出", + "bind_coin_count"=>"内充支出", + "inside_cash_count"=>"平台币内充", + "allcount"=>"渠道游戏内充值合计" + )); + } $size = $row; $data = array_slice($data, ($arraypage - 1) * $size, $size); $this->assign('all_count', $allcount); $this->assign('list_data', $data); + $this->meta_title = '渠道统计'; $this->display(); // dump($senddata); @@ -334,8 +346,28 @@ class FinancePromoteController extends AdminController //游戏统计列表 $data =self::gameStatisticsData($map, $row, $p); - foreach ($data as $key => $value) { - $data[$key]['all_cash_count'] = $value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count']; + if(isset($_REQUEST['export'])){ + $data =self::gameStatisticsData($map); + }else { + $data =self::gameStatisticsData($map, $row, $p); + } + foreach ($data as $key => &$value) { + $value['cash_count']?:0; + $value['balance_coin_count']?:0; + $value['inside_cash_count']?:0; + $value['all_cash_count'] = $value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count']; + if(!$value['partner_name']) $value['partner_name'] = "无"; + if(!$value['game_name']) $value['game_name'] = "无"; + } + if (isset($_REQUEST['export'])) { + data2csv($data,'游戏统计', array( + "partner_name"=>"合作公司", + "game_name"=>"游戏", + "cash_count"=>"游戏现金金额", + "balance_coin_count"=>"平台币直充支出", + "inside_cash_count"=>"内充支出", + "all_cash_count"=>"游戏内充值合计" + )); } $allData = self::gameStatisticsData($map);//列表总数 @@ -358,7 +390,7 @@ class FinancePromoteController extends AdminController $this->assign('sumInside', $sumInside); $this->assign('sumAll', $sumAll); $this->assign('data',$data); - + $this->meta_title = '游戏统计'; $this->display(); } //游戏订单详情 @@ -450,11 +482,29 @@ class FinancePromoteController extends AdminController $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"; $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,$order); + }else { + $data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row); + } foreach($data as $key => $value) { $data[$key]['pay_way'] = getPayType($value['pay_way']); } - + if (isset($_REQUEST['export'])) { + data2csv($data,'游戏订单查看', array( + "pay_order_number"=>"支付订单号", + "pay_time"=>"充值时间", + "user_account"=>"玩家账号", + "game_name"=>"游戏名称", + "promote_account"=>"所属推广员", + "spend_ip"=>"充值ip", + "server_name"=>"游戏区服", + "game_player_name"=>"角色名称", + "cost"=>"订单金额", + "pay_amount"=>"实付金额", + "pay_way"=>"充值方式", + )); + } $totalData = self::totalGameStatisticsData($map, false); $sumCash = $totalData['cash_count'] ?? 0; $sumBalance = $totalData['balance_coin_count'] ?? 0; @@ -490,7 +540,7 @@ class FinancePromoteController extends AdminController ->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id') ->where($map) ->group('s.game_id'); - if ($row) { + if ($row != 0) { $query = $query->page($page,$row); } $data = $query->select(); @@ -587,13 +637,37 @@ class FinancePromoteController extends AdminController $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']); } + if (isset($_REQUEST['export'])) { + $field = array( + "pay_order_number"=>"支付订单号", + "pay_time"=>"充值时间", + "user_account"=>"玩家账号", + "game_name"=>"游戏名称", + "server_name"=>"游戏区服", + "game_player_name"=>"角色名称", + "cost"=>"订单金额", + "pay_amount"=>"实付金额", + "pay_way"=>"充值方式" + ); + if ($map['pay_way'] ==-1) { + $field["bind_balance"] = "绑定币余额"; + $title = "内充支出明细"; + } elseif ($map['pay_way'] ==0) { + $field["balance"] = "平台币余额"; + $title = "平台币直充明细"; + } + data2csv($data,$title,$field); + } $count = D("spend")->getSpendData($map,$field,$group,$order); $count = count($count); $page = set_pagination($count,$row); diff --git a/Application/Admin/View/FinancePromote/gameCoinDetail.html b/Application/Admin/View/FinancePromote/gameCoinDetail.html index 805b30370..0963003c4 100644 --- a/Application/Admin/View/FinancePromote/gameCoinDetail.html +++ b/Application/Admin/View/FinancePromote/gameCoinDetail.html @@ -68,18 +68,6 @@
搜索 - - 导出 -
@@ -137,6 +125,8 @@
+ 导出 {$_page}
 diff --git a/Application/Admin/View/FinancePromote/gameStatistics.html b/Application/Admin/View/FinancePromote/gameStatistics.html index 0440d2343..351866187 100644 --- a/Application/Admin/View/FinancePromote/gameStatistics.html +++ b/Application/Admin/View/FinancePromote/gameStatistics.html @@ -130,17 +130,6 @@
搜索 - - 导出
@@ -186,15 +175,14 @@ - {$data.partner_name} - {$data.game_name} - {$data.cash_count}0 - - {$data.balance_coin_count}0 + {$data.partner_name} + {$data.game_name} + {$data.cash_count} + {$data.balance_coin_count} - {$data.inside_cash_count}0 - {$data.all_cash_count}0 + {$data.inside_cash_count} + + {$data.all_cash_count} 订单查看 @@ -217,7 +205,7 @@
- + 导出 {$_page|default=''}
@@ -257,7 +245,7 @@ }); - $('.page a').click(function () { + $('.page a:eq(1)').click(function () { var href = $(this).attr('href'); $(this).removeAttr('href'); window.location.replace(href) diff --git a/Application/Admin/View/FinancePromote/gameStatisticsDetail.html b/Application/Admin/View/FinancePromote/gameStatisticsDetail.html index 77aec8c95..9267474e4 100644 --- a/Application/Admin/View/FinancePromote/gameStatisticsDetail.html +++ b/Application/Admin/View/FinancePromote/gameStatisticsDetail.html @@ -145,18 +145,6 @@ 搜索 - - 导出 - @@ -233,7 +221,7 @@
- + 导出 {$_page|default=''}
@@ -256,7 +244,7 @@ highlight_subnav('{:U("FinancePromote/index")}'); $(function(){ - $('.page a').click(function () { + $('.page a:eq(1)').click(function () { var href = $(this).attr('href'); $(this).removeAttr('href'); window.location.replace(href) diff --git a/Application/Admin/View/FinancePromote/promoteUser.html b/Application/Admin/View/FinancePromote/promoteUser.html index 3896815ea..4513957e9 100644 --- a/Application/Admin/View/FinancePromote/promoteUser.html +++ b/Application/Admin/View/FinancePromote/promoteUser.html @@ -231,7 +231,7 @@
导出 + href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}">导出 {$_page|default=''}
@@ -299,7 +299,7 @@ window.location.replace(url); // window.location.href = url; }); - $('.page a').click(function () { + $('.page a:eq(1)').click(function () { var href = $(this).attr('href'); $(this).removeAttr('href'); window.location.replace(href)