From ead339046f15f76ff8df2459bea578cad64a02ac Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Mon, 16 Dec 2019 21:30:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ExportController.class.php | 6 +- .../Controller/FinanceController.class.php | 83 ++++++ .../Admin/View/Finance/gameStatistics.html | 40 +-- .../View/Finance/gameStatisticsDetail.html | 250 ++++++++++++++++++ 4 files changed, 361 insertions(+), 18 deletions(-) create mode 100644 Application/Admin/View/Finance/gameStatisticsDetail.html diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 8f93aab6c..034046398 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -6489,9 +6489,9 @@ if ($key == 'model'){ $map['_string'] .= " and s.pay_time < {$timeend}"; } - $data = D("spend")->gameStatistics($map); - foreach ($data as $key => $value) { - $data[$key]['all_cash_count'] = $value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count']; + $xlsData = D("spend")->gameStatistics($map); + foreach ($xlsData as $key => $value) { + $xlsData[$key]['all_cash_count'] = $value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count']; } $totalData = D("spend")->totalGameStatistics($map); diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 6efe2a91a..ad2411cd3 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -738,6 +738,89 @@ class FinanceController extends ThinkController $this->assign('sumAll', $sumAll); $this->assign('data',$data); + $this->display(); + } + + public function gameStatisticsDetail($p = 1) { + set_time_limit(0); + if (!empty(I("promote_id"))) { + $promote_id[] = I("promote_id"); + } + + if (!empty(I("root_id"))) { + $root_id = I("root_id"); + $promote_id = $this->getPromoteList($root_id); + array_push($promote_id,$root_id); + } + + if ($_REQUEST['root_id']=='0') { + $map['promote_id'] = $_REQUEST['root_id']; + } + + if (!empty(I("parent_id"))) { + $parent_id = I("parent_id"); + $promote_id = $this->getPromoteList($parent_id); + array_push($promote_id,$parent_id); + } + + $promote_id = implode(',',$promote_id); + if ($promote_id) { + $map['promote_id'] = ['in',$promote_id]; + } + + if (!empty(I('partner_id'))&&empty(I("game_id"))) { + $wherePartner = I('partner_id'); + $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select(); + $gameId = implode(',',array_column($gameId,'id')); + $map['game_id'] = ['in',$gameId]; + } +// var_dump($map);die(); + $page = intval($p); + $page = $page ? $page : 1; //默认显示第一页数据 + $row=10; + if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} + + if (!empty(I("count_date"))) { + $month = I("count_date"); + $tarry = explode('-',$month); + $startTime=mktime(0,0,0,$tarry[1],1,$tarry[0]); + $endTime =mktime(0,0,0,$tarry[1]-0+1,1,$tarry[0])-1; + $map['pay_time'] = array('between',array($startTime,$endTime)); + } + + $map['pay_status'] = 1; + if (!empty(I("game_id"))) { + $map['game_id'] = I("game_id"); + } + if (!empty(I('user_account'))) { + $map['user_account'] = array('like','%'.I("user_account").'%'); + } + if (!empty(I('user_nickname'))) { + $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"; + $group = ""; + $order = "pay_time DESC"; + $data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row); +// echo D("spend")->_sql();die(); + + foreach($data as $key => $value) { + $data[$key]['pay_way'] = getPayType($value['pay_way']); + } + + $sum = D('spend')->sumSpend($map,'pay_amount'); + + $count = D("spend")->getSpendData($map,$field,$group,$order); + + $count = count($count); + $page = set_pagination($count,$row); + if($page) {$this->assign('_page', $page);} + $this->meta_title = '游戏充值流水'; + + $this->assign('data',$data); + $this->assign('sum_amount',$sum); + $this->display(); } diff --git a/Application/Admin/View/Finance/gameStatistics.html b/Application/Admin/View/Finance/gameStatistics.html index d8ce722db..5c3af308e 100644 --- a/Application/Admin/View/Finance/gameStatistics.html +++ b/Application/Admin/View/Finance/gameStatistics.html @@ -115,19 +115,20 @@ - - - - -
支付订单号 | + +充值时间 | + +玩家账号 | + +游戏名称 | + +所属推广员 | + +充值ip | + +游戏区服 | + +角色名称 | + +订单金额 | + +实付金额 | + +充值方式 | +|||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aOh! 暂时还没有内容! | +|||||||||||||
{$data.pay_order_number} | +{$data.pay_time} | +{$data.user_account} | +{$data.game_name} | +{$data.promote_account} | +{$data.spend_ip} | +{$data.server_name} | +{$data.game_player_name} | +{$data.cost} | +{$data.pay_amount} | +{$data.pay_way} | +|||
总计 | +