平台币直充明细列表,搜索,导出

内充支出明细列表,搜索,导出
master
liuweiwen 5 years ago
parent 53a235379a
commit cdbf059ee4

@ -6590,6 +6590,110 @@ if ($key == 'model'){
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
public function coinDetail() {
$xlsCell = array(
array('pay_order_number','支付订单号'),
array('pay_time','充值时间'),
array('user_account','玩家账号'),
array('game_name','游戏名称'),
array('server_name','游戏区服'),
array('game_player_name','角色名称'),
array('cost','订单金额'),
array('pay_amount','实付金额'),
array('pay_way','充值方式'),
);
$map = array();
if (isset($_REQUEST['pay_way'])) {
$map['pay_way'] = $_REQUEST['pay_way'];
}
$game_name = I("game_name");
if (!empty($_REQUEST['pay_order_number'])) {
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
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['tab_spend.game_id'] = ['in',$gameId];
}
if (!empty(I('timestart'))) {
$timestart = strtotime(I('timestart'));
$map['_string'] = "pay_time > {$timestart}";
}
if (!empty(I('timeend'))) {
$timeend = strtotime(I('timeend'));
$map['_string'] .= " and pay_time < {$timeend}";
}
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['tab_spend.promote_id'] = $_REQUEST['root_id'];
}
$promote_id = implode(',',$promote_id);
if ($promote_id) {
$map['tab_spend.promote_id'] = ['in',$promote_id];
}
$map['pay_status'] = 1;
if (!empty(I("game_id"))) {
$map['tab_spend.game_id'] = I("game_id");
}
if (!empty(I('user_account'))) {
$map['tab_spend.user_account'] = array('like','%'.I("user_account").'%');
}
if (!empty(I('user_nickname'))) {
$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,
game_player_name,pay_amount,cost,pay_way";
$group = "";
$order = "pay_time DESC";
$join = false;
if ($map['pay_way'] ==-1) {//绑定币
$xlsCell[] = array('bind_balance','绑定币余额');
$xlsName = $game_name . '内充支出明细';
$field2 = $field . ',bind_balance';
$join = 'left join tab_user_play as p on p.user_id = tab_spend.user_id and tab_spend.game_id=p.game_id';
} elseif ($map['pay_way'] ==0) {//平台币
$xlsCell[] = array('balance','平台币余额');
$xlsName = $game_name . '平台币直充明细';
$field2 = $field . ',balance';
$join = 'left join tab_user as u on u.id = tab_spend.user_id';
}
$xlsData = D('spend')->getSpendData($map, $field2, $group, $order, 0, 0, $join);
foreach($xlsData as $key => $value) {
$xlsData[$key]['pay_way'] = getPayType($value['pay_way']);
}
$map['pay_game_status'] = 1;
$total_cost = D('spend')->sumSpend($map, 'cost');
$total_pay_amount = D('spend')->sumSpend($map, 'pay_amount');
$sumData = [['pay_order_number'=>'总计',
'cost'=> $total_cost,
'pay_amount'=> $total_pay_amount]];
$xlsData = array_merge($xlsData,$sumData);
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
function gameFinanceDetail() {
// set_time_limit(0);

@ -780,7 +780,26 @@ class FinanceController extends ThinkController
$timeend = strtotime(I('timeend'));
$map['_string'] .= " and pay_time < {$timeend}";
}
// var_dump($map);die();
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'];
}
$promote_id = implode(',',$promote_id);
if ($promote_id) {
$map['promote_id'] = ['in',$promote_id];
}
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
if (isset($_REQUEST['row'])) {
@ -826,11 +845,116 @@ class FinanceController extends ThinkController
$this->meta_title = '游戏订单查看';
$this->assign('data',$data);
$from = I('from', '');
$this->display($from);
}
public function coinDetail($p = 1) {
set_time_limit(0);
if (isset($_REQUEST['pay_way'])) {
$map['pay_way'] = $_REQUEST['pay_way'];
$this->assign('pay_way', $map['pay_way']);
}
if (!empty($_REQUEST['pay_order_number'])) {
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
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['tab_spend.game_id'] = ['in',$gameId];
}
if (!empty(I('timestart'))) {
$timestart = strtotime(I('timestart'));
$map['_string'] = "pay_time > {$timestart}";
}
if (!empty(I('timeend'))) {
$timeend = strtotime(I('timeend'));
$map['_string'] .= " and pay_time < {$timeend}";
}
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['tab_spend.promote_id'] = $_REQUEST['root_id'];
}
$promote_id = implode(',',$promote_id);
if ($promote_id) {
$map['tab_spend.promote_id'] = ['in',$promote_id];
}
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
$map['pay_status'] = 1;
if (!empty(I("game_id"))) {
$map['tab_spend.game_id'] = I("game_id");
}
if (!empty(I('user_account'))) {
$map['tab_spend.user_account'] = array('like','%'.I("user_account").'%');
}
if (!empty(I('user_nickname'))) {
$map['tab_spend.game_player_name'] = array('like',I("user_nickname").'%');
}
// 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,
game_player_name,pay_amount,cost,pay_way";
$group = "";
$order = "pay_time DESC";
$join = false;
if ($map['pay_way'] ==-1) {//绑定币
$field2 = $field . ',bind_balance';
$join = 'left join tab_user_play as p on p.user_id = tab_spend.user_id and tab_spend.game_id=p.game_id';
} elseif ($map['pay_way'] ==0) {//平台币
$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);
foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
}
$count = D("spend")->getSpendData($map,$field,$group,$order);
$count = count($count);
$page = set_pagination($count,$row);
$map['pay_game_status'] = 1;
$total_cost = D('spend')->sumSpend($map, 'cost');//订单金额合计
$total_pay_amount = D('spend')->sumSpend($map, 'pay_amount');//实付金额合计
$this->assign('total_cost', $total_cost);
$this->assign('total_pay_amount', $total_pay_amount);
if($page) {$this->assign('_page', $page);}
$this->meta_title = '游戏订单查看';
$this->assign('data',$data);
$this->display();
}
/**
*获取合作公司
*/

@ -810,14 +810,17 @@ class SpendModel extends Model
/**
* 获取统计 $map,$page,$row
*/
public function getSpendData($map = [], $field = '', $group = '', $order = '', $page = 0, $row = 0)
public function getSpendData($map = [], $field = '', $group = '', $order = '', $page = 0, $row = 0, $join = false)
{
$query = $this->field($field)->where($map)->group($group)->order($order);
if ($join) {
$query = $query->join($join);
}
if ($row == 0) {
$data = $this->field($field)->where($map)->group($group)->order($order)->select();
$data = $query->select();
} else {
$data = $this->field($field)->where($map)->page($page, $row)->group($group)->order($order)->select();
$data = $query->page($page, $row)->select();
}
return $data;
}
@ -844,7 +847,7 @@ SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count")
->join('LEFT JOIN tab_game as g ON s.game_id=g.id')
->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id')
->where(['s.pay_status' => 1])
->where(['s.pay_status' => 1, 'pay_game_status' => 1])
->where($map)
->group('s.game_id');
if ($row) {
@ -867,7 +870,7 @@ SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count");
$query = $query->join('LEFT JOIN tab_game as g ON s.game_id=g.id')
->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id');
}
$data = $query->where(['s.pay_status' => 1])
$data = $query->where(['s.pay_status' => 1, 'pay_game_status' => 1])
->where($map)
->find();
return $data;

@ -0,0 +1,146 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>游戏登陆列表|----软件管理平台</title>
<link href="http://admin.vlcms.com/Public/icon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/module.css">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
</head>
<style>
body {
padding: 0px;
}
</style>
<body>
<div id="main" class="main" style="min-height: 342px;width: 90%;">
<!-- 标题栏 -->
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<!--游戏类型搜索END-->
<input type="hidden" name="game_id" value="{$_GET['game_id']}"/>
<input type="hidden" name="game_name" value="{$_GET['game_name']}"/>
<div class="input-list">
<input type="text" name="pay_order_number" placeholder="请输入支付订单号" class="" value="{:I('pay_order_number')}" style="width: 180px"/>&nbsp;
</div>
<div class="input-list">
<input type="text" name="user_account" placeholder="请输入玩家账号" class="" value="{:I('user_account')}" style="width: 180px"/>&nbsp;
</div>
<div class="input-list">
<input type="text" name="user_nickname" placeholder="请输入角色名称" class="" value="{:I('user_nickname')}" style="width: 180px"/>&nbsp;
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Finance/coinDetail','model='.$model['name'].'&row='.I('row'),false)}"
style="">搜索</a>
<if condition="$_GET['all'] neq 1">
<a class="sch-btn" href="{:U('Export/coinDetail',
array(
'game_id'=>$_GET['game_id'],
'game_name'=>$_GET['game_name'],
'pay_way'=>$_GET['pay_way'],
'timestart'=>$_GET['timestart'],
'timeend'=>$_GET['timeend'],
'user_account'=>$_GET['user_account'],
'pay_order_number'=>$_GET['pay_order_number'],
false))}">导出</a>
</if>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list box_mt">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th >支付订单号</th>
<th>充值时间</th>
<th >玩家账号</th>
<th >游戏名称</th>
<th >游戏区服</th>
<th >角色名称</th>
<th >订单金额</th>
<th >实付金额</th>
<th >充值方式</th>
<th ><if condition="$pay_way eq -1">绑定币余额<else/>平台币余额</if></th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<volist name="data" id="data">
<tr>
<td >{$data.pay_order_number}</td>
<td >{$data.pay_time}</td>
<td >{$data.user_account}</td>
<td >{$data.game_name}</td>
<td >{$data.server_name}</td>
<td >{$data.game_player_name}</td>
<td >{$data.cost}</td>
<td >{$data.pay_amount}</td>
<td >{$data.pay_way}</td>
<if condition="$pay_way eq -1">
<td >{$data.bind_balance}</td>
<else/>
<td >{$data.balance}</td>
</if>
</tr>
</volist>
<tr>
<td colspan="6" ><span>总计</span></td>
<td ><span><if condition="$total_cost neq ''">{$total_cost}<else/>0</if></span></td>
<td><if condition="$total_pay_amount neq ''">{$total_pay_amount}<else/>0</if></td>
<td colspan="2"> </td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="page">
{$_page}
</div>

</div>
<script>
$(function(){
//搜索功能
$("#search").click(function(){
console.log(222);
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if ( url.indexOf('?')>0 ){
url += '&' + query;
} else {
url += '?' + query;
}
window.parent.reloadIframe(url);
parent.document.getElementsByTagName('iframe').src = url;
console.log(url);
});
});
</script>
</body>
</html>

@ -178,8 +178,26 @@
<td ><if condition="$data.partner_name neq ''">{$data.partner_name}<else/></if></td>
<td ><if condition="$data.game_name neq ''">{$data.game_name}<else/></if></td>
<td ><if condition="$data.cash_count neq ''">{$data.cash_count}<else/>0</if></td>
<td ><if condition="$data.balance_coin_count neq ''">{$data.balance_coin_count}<else/>0</if></td>
<td ><if condition="$data.inside_cash_count neq ''">{$data.inside_cash_count}<else/>0</if></td>
<td class="coin-detail" data-pay_type="0" style="color: #0066cc;cursor: pointer"
data-url="{:U('Finance/coinDetail',array(
'timestart'=>$_GET['timestart'],
'timeend'=>$_GET['timeend'],
'sdk_type'=>$_GET['sdk_type'],
'game_id'=>$data['game_id'],
'game_name'=>$data['game_name'],
'partner_id'=>$_REQUEST['partner_id'],
'pay_way'=>0,
false))}">
<if condition="$data.balance_coin_count neq ''">{$data.balance_coin_count}<else/>0</if></td>
<td class="coin-detail" data-pay_type="-1" style="color: #0066cc;cursor: pointer" data-url="{:U('Finance/coinDetail',array(
'timestart'=>$_GET['timestart'],
'timeend'=>$_GET['timeend'],
'sdk_type'=>$_GET['sdk_type'],
'game_id'=>$data['game_id'],
'game_name'=>$data['game_name'],
'partner_id'=>$_REQUEST['partner_id'],
'pay_way'=>-1,
false))}"><if condition="$data.inside_cash_count neq ''">{$data.inside_cash_count}<else/>0</if></td>
<td ><if condition="$data.all_cash_count neq ''">{$data.all_cash_count}<else/>0</if></td>
<td >
<a href="{:U('Finance/gameStatisticsDetail',array(
@ -238,6 +256,26 @@
</script>
<script type="text/javascript">
function reloadIframe(url) {
$("iframe").attr('src', url);
// document.getElementsByTagName('iframe').src=url;
}
$(".coin-detail").click(function () {
var pay_type = $(this).data('pay_type');
var url = $(this).data('url');
var title = pay_type == -1 ? '内充支出明细' : '平台币直充明细';
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: [url, 'no']
});
});
$('.page a').click(function () {
var href = $(this).attr('href');
$(this).removeAttr('href');
@ -251,6 +289,7 @@
//搜索功能
$("#search").click(function(){
console.log(111);
var starttime = $.trim($('#time-start').val());
var endtime = $.trim($('#time-end').val());

@ -54,10 +54,10 @@
<input type="text" name="user_account" placeholder="请输入玩家账号" class="" value="{:I('user_account')}" style="width: 180px"/>&nbsp;
</div>
<!-- <div class="input-list">-->
<div class="input-list">
<!-- <input type="text" name="user_nickname" placeholder="请输入角色名称" class="" value="{:I('user_nickname')}" style="width: 180px"/>&nbsp;-->
<!-- </div>-->
<input type="text" name="user_nickname" placeholder="请输入角色名称" class="" value="{:I('user_nickname')}" style="width: 180px"/>&nbsp;
</div>
<div class="input-list">
<input type="text" readonly id="time-start" name="timestart" class="" value="{$startDate}"
placeholder="开始时间"/>

Loading…
Cancel
Save