diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 7ae4e5ab8..8f1e46a20 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1455,4 +1455,50 @@ function getMonth() { return $range; } +function getPayType($type) { + + $return = ''; + + switch ($type) { + case -1: + $return = '绑币'; + break; + case 0: + $return = '平台币'; + break; + case 1: + $return = '支付宝'; + break; + case 2: + $return = '微信(扫码)'; + break; + case 3: + $return = '微信app'; + break; + case 4: + $return = '威富通'; + break; + case 5: + $return = '聚宝云'; + break; + case 6: + $return = '竣付通'; + break; + default: + $return = '未知'; + break; + } + + return $return; + +} +function getPartner() { + + $map['status'] = 1; + $data = M('partner','tab_')->field('id,partner')->where($map)->select(); + + return $data; + +} + ?> diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 853f1dba4..ffca0c5aa 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -5391,7 +5391,65 @@ if ($key == 'model'){ $xlsData = array_merge($xlsData,$sumData); $this->exportExcel($xlsName, $xlsCell, $xlsData); + } + + function gameFinanceDetail() { + + + $month = I("count_date"); + $xlsName = '充值流水'; + + $xlsCell = array( + array('pay_order_number','支付订单号'), + array('pay_time','充值时间'), + array('user_account','玩家账号'), + array('game_name','游戏名称'), + array('promote_account','所属推广员'), + array('spend_ip','充值ip'), + array('server_name','游戏区服'), + array('game_player_name','角色名称'), + array('cost','订单金额'), + array('pay_amount','实付金额'), + array('pay_way','充值方式'), + ); + + if (!empty(I("count_date"))) { + $month = I("count_date"); + } else { + $this->error('月份不能为空'); + } + + $startTime = strtotime(date("Y-m-01",strtotime($month))); + $endTime = strtotime(date("Y-m-t",strtotime($month))); + $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'] = I("user_account"); + } + if (!empty(I('user_nickname'))) { + $map['user_nickname'] = I("user_nickname"); + } + + $field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way"; + $group = ""; + $order = "pay_time DESC"; + $xlsData = D('spend')->getSpendData($map,$field,$group,$order); + + foreach($xlsData as $key => $value) { + $data[$key]['pay_way'] = getPayType($value['pay_way']); + } + + $sum = D('spend')->sumSpend($map,'pay_amount'); + + $sumData = [['pay_order_number'=>'总计', + 'pay_way'=>$sum]]; + $xlsData = array_merge($xlsData,$sumData); + + $this->exportExcel($xlsName, $xlsCell, $xlsData); } } diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 3b4576491..1ec2c906a 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -25,8 +25,8 @@ class FinanceController extends ThinkController if (!empty(I('game_id'))) { $map['game_id']=I('game_id'); } - if (!empty(I('collaborate_id'))) { - $map['collaborate_id']=I('collaborate_id'); + if (!empty(I('partner_id'))) { + $map['partner_id']=I('collaborate_id'); } // $data = M("spend_count","tab_") @@ -97,7 +97,7 @@ class FinanceController extends ThinkController $field = "count_date,sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count, - sum(bind_coin_count) as inside_cash_count,sum(cash_count+balance_coin_count+bind_coin_count) as all_cash_count,game_name,game_id,collaborate_name"; + sum(bind_coin_count) as inside_cash_count,sum(cash_count+balance_coin_count+bind_coin_count) as all_cash_count,game_name,game_id,partner_name"; $group = "game_id"; $order = "id DESC"; @@ -147,10 +147,10 @@ class FinanceController extends ThinkController $map['game_id'] = I("game_id"); } if (!empty(I('user_account'))) { - $map['user_account'] = I("user_account"); + $map['user_account'] = array('like','%'.I("user_account").'%'); } if (!empty(I('user_nickname'))) { - $map['user_nickname'] = I("user_nickname"); + $map['user_nickname'] = array('like',I("user_nickname").'%'); } $field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way"; @@ -159,7 +159,7 @@ class FinanceController extends ThinkController $data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row); foreach($data as $key => $value) { - $data[$key]['pay_way'] = $this->getPayType($value['pay_way']); + $data[$key]['pay_way'] = getPayType($value['pay_way']); } $sum = D('spend')->sumSpend($map,'pay_amount'); @@ -177,43 +177,5 @@ class FinanceController extends ThinkController } - public function getPayType($type) { - - $return = ''; - - switch ($type) { - case -1: - $return = '绑币'; - break; - case 0: - $return = '平台币'; - break; - case 1: - $return = '支付宝'; - break; - case 2: - $return = '微信(扫码)'; - break; - case 3: - $return = '微信app'; - break; - case 4: - $return = '威富通'; - break; - case 5: - $return = '聚宝云'; - break; - case 6: - $return = '竣付通'; - break; - default: - $return = '未知'; - break; - } - - return $return; - - } - } \ No newline at end of file diff --git a/Application/Admin/View/Finance/gameFinance.html b/Application/Admin/View/Finance/gameFinance.html index cf474f7d1..6eafa0d23 100644 --- a/Application/Admin/View/Finance/gameFinance.html +++ b/Application/Admin/View/Finance/gameFinance.html @@ -41,7 +41,7 @@
- 返回 + 返回 导出
@@ -87,14 +87,14 @@ {$data.game_name} - {$data.collaborate_name} + {$data.partner_name} {$data.cash_count} {$data.balance_coin_count} {$data.inside_cash_count} {$data.all_cash_count} 查看 + array('count_date'=>$_REQUEST['count_date'],'game_id'=>$data['game_id'],'game_name'=>$data['game_name']))}" >查看 diff --git a/Application/Admin/View/Finance/gameFinanceDetail.html b/Application/Admin/View/Finance/gameFinanceDetail.html index 5749609da..377f272fd 100644 --- a/Application/Admin/View/Finance/gameFinanceDetail.html +++ b/Application/Admin/View/Finance/gameFinanceDetail.html @@ -30,7 +30,7 @@ @@ -41,10 +41,13 @@
- 返回 - 导出 + 返回 + 导出
+ + +
  @@ -53,6 +56,11 @@  
+
+ + 搜索 +
diff --git a/Application/Admin/View/Finance/index.html b/Application/Admin/View/Finance/index.html index e10de7d2b..ec82c2af5 100644 --- a/Application/Admin/View/Finance/index.html +++ b/Application/Admin/View/Finance/index.html @@ -57,8 +57,11 @@
- + + +