财务管理bug修正,导出功能,合作方列表添加

master
zyx 5 years ago
parent 224c745ba8
commit c65aa8d69a

@ -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;
}
?>

@ -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);
}
}

@ -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;
}
}

@ -41,7 +41,7 @@
<!--游戏类型搜索END-->
<div class="input-list">
<a class="sch-btn" href="javascript:;" onclick="javascript:history.back(-1);" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="{:U('Finance/index')}" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="{:U('Export/exportGameFinance',
array('count_date'=>$_GET['count_date'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
</div>
@ -87,14 +87,14 @@
<volist name="data" id="data">
<tr>
<td >{$data.game_name}</td>
<td >{$data.collaborate_name}</td>
<td >{$data.partner_name}</td>
<td >{$data.cash_count}</td>
<td >{$data.balance_coin_count}</td>
<td >{$data.inside_cash_count}</td>
<td >{$data.all_cash_count}</td>
<td >
<a href="{:U('Finance/gameFinanceDetail',
array('count_date'=>$_REQUEST['count_date'],'game_id'=>$data['game_id']))}" >查看</a>
array('count_date'=>$_REQUEST['count_date'],'game_id'=>$data['game_id'],'game_name'=>$data['game_name']))}" >查看</a>
</td>
</tr>
</volist>

@ -30,7 +30,7 @@
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$_REQUEST['count_date']}月结统计</h3>
<h3 class="page_title">{$_REQUEST['game_name']}充值流水</h3>
<p class="description_text"></p>
</div>
@ -41,10 +41,13 @@
<!--游戏类型搜索END-->
<div class="input-list">
<a class="sch-btn" href="javascript:;" onclick="javascript:history.back(-1);" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="{:U('Export/exportGameFinance',
array('count_date'=>$_GET['count_date'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
<a class="sch-btn" href="{:U('Finance/gameFinance',array('count_date'=>$_GET['count_date']))}" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
<a class="sch-btn" href="{:U('Export/gameFinanceDetail',
array('count_date'=>$_GET['count_date'],'game_id'=>$_GET['game_id'],'game_name'=>$_GET['game_name'],'user_account'=>$_GET['user_account'],'user_nickname'=>$_GET['user_nickname'],false))}" style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
</div>
<input type="hidden" name="count_date" value="{$_GET['count_date']}"/>
<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="user_account" placeholder="请输入玩家账号搜索" class="" value="{:I('user_account')}"/>&nbsp;
@ -53,6 +56,11 @@
<input type="text" name="user_nickname" placeholder="请输入玩家昵称搜索" class="" value="{:I('user_nickname')}"/>&nbsp;
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Finance/gameFinanceDetail','model='.$model['name'].'&row='.I('row'),false)}"
style="">搜索</a>
</div>
</div>
</div>

@ -57,8 +57,11 @@
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="collaborate_id" name="collaborate_id" class="select_gallery" style="width:120px;">
<select id="partner_id" name="partner_id" class="select_gallery" style="width:120px;">
<option value="">请选择合作方</option>
<volist name=":getPartner()" id="vo">
<option value="{$vo.id}" <if condition="$vo.id eq $_GET['partner_id']">selected=selected</if>>{$vo.partner}</option>
</volist>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">

Loading…
Cancel
Save