公会导出2

master
chenzhi 5 years ago
parent d1a5b63be2
commit 2651a94408

@ -92,7 +92,7 @@ class FinancePromoteController extends AdminController
"bind_coin_count"=>"内充支出", "bind_coin_count"=>"内充支出",
"inside_cash_count"=>"平台币内充", "inside_cash_count"=>"平台币内充",
"allcount"=>"渠道游戏内充值合计" "allcount"=>"渠道游戏内充值合计"
));die(); ));
} }
$this->assign('list_data', $data); $this->assign('list_data', $data);
$this->assign('all_count', $count); $this->assign('all_count', $count);
@ -235,10 +235,22 @@ class FinancePromoteController extends AdminController
} }
$data = my_sort($data, $data_order_type, (int)$data_order); $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; $size = $row;
$data = array_slice($data, ($arraypage - 1) * $size, $size); $data = array_slice($data, ($arraypage - 1) * $size, $size);
$this->assign('all_count', $allcount); $this->assign('all_count', $allcount);
$this->assign('list_data', $data); $this->assign('list_data', $data);
$this->meta_title = '渠道统计';
$this->display(); $this->display();
// dump($senddata); // dump($senddata);
@ -334,8 +346,28 @@ class FinancePromoteController extends AdminController
//游戏统计列表 //游戏统计列表
$data =self::gameStatisticsData($map, $row, $p); $data =self::gameStatisticsData($map, $row, $p);
foreach ($data as $key => $value) { if(isset($_REQUEST['export'])){
$data[$key]['all_cash_count'] = $value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count']; $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);//列表总数 $allData = self::gameStatisticsData($map);//列表总数
@ -358,7 +390,7 @@ class FinancePromoteController extends AdminController
$this->assign('sumInside', $sumInside); $this->assign('sumInside', $sumInside);
$this->assign('sumAll', $sumAll); $this->assign('sumAll', $sumAll);
$this->assign('data',$data); $this->assign('data',$data);
$this->meta_title = '游戏统计';
$this->display(); $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"; $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 = ""; $group = "";
$order = "pay_time DESC"; $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) { foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']); $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); $totalData = self::totalGameStatisticsData($map, false);
$sumCash = $totalData['cash_count'] ?? 0; $sumCash = $totalData['cash_count'] ?? 0;
$sumBalance = $totalData['balance_coin_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') ->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id')
->where($map) ->where($map)
->group('s.game_id'); ->group('s.game_id');
if ($row) { if ($row != 0) {
$query = $query->page($page,$row); $query = $query->page($page,$row);
} }
$data = $query->select(); $data = $query->select();
@ -587,13 +637,37 @@ class FinancePromoteController extends AdminController
$field2 = $field . ',balance'; $field2 = $field . ',balance';
$join = 'left join tab_user as u on u.id = tab_spend.user_id'; $join = 'left join tab_user as u on u.id = tab_spend.user_id';
} }
if(isset($_REQUEST['export'])){
$data = D('spend')->getSpendData($map, $field2, $group, $order, $page, $row, $join); $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) { foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']); $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 = D("spend")->getSpendData($map,$field,$group,$order);
$count = count($count); $count = count($count);
$page = set_pagination($count,$row); $page = set_pagination($count,$row);

@ -68,18 +68,6 @@
<div class="input-list"> <div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('FinancePromote/gameCoinDetail','model='.$model['name'].'&row='.I('row'),false)}" <a class="sch-btn" href="javascript:;" id="search" url="{:U('FinancePromote/gameCoinDetail','model='.$model['name'].'&row='.I('row'),false)}"
style="">搜索</a> 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>
</div> </div>
@ -137,6 +125,8 @@
</div> </div>
</div> </div>
<div class="page"> <div class="page">
<a class="sch-btn"
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}">导出</a>
{$_page} {$_page}
</div> </div>
 

@ -130,17 +130,6 @@
<div class="input-list"> <div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('FinancePromote/gameStatistics','model='.$model['name'].'&row='.I('row'),false)}" <a class="sch-btn" href="javascript:;" id="search" url="{:U('FinancePromote/gameStatistics','model='.$model['name'].'&row='.I('row'),false)}"
style="width: 100px;border: #3C95C8 solid 1px;">搜索</a> style="width: 100px;border: #3C95C8 solid 1px;">搜索</a>
<!-- <a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>-->
<a class="sch-btn" href="{:U('Export/exportGameStatistics',
array(
'timestart'=>$_GET['timestart'],
'timeend'=>$_GET['timeend'],
'sdk_type'=>$_GET['sdk_type'],
'game_name'=>$_GET['game_name'],
'game_id'=>$_REQUEST['game_id'],
'partner_id'=>$_REQUEST['partner_id'],
false))}"
style="width: 100px;border: #3C95C8 solid 1px;">导出</a>
</div> </div>
@ -186,15 +175,14 @@
<notemtpy name = "data"> <notemtpy name = "data">
<volist name="data" id="data"> <volist name="data" id="data">
<tr> <tr>
<td ><if condition="$data.partner_name neq ''">{$data.partner_name}<else/></if></td> <td >{$data.partner_name}</td>
<td ><if condition="$data.game_name neq ''">{$data.game_name}<else/></if></td> <td >{$data.game_name}</td>
<td ><if condition="$data.cash_count neq ''">{$data.cash_count}<else/>0</if></td> <td >{$data.cash_count}</td>
<td class="coin-detail" data-pay_type="0" style="color: #0066cc;cursor: pointer" <td class="coin-detail" data-pay_type="0" style="color: #0066cc;cursor: pointer" data-url="{:U('FinancePromote/gameCoinDetail',array_merge(I('get.'),['pay_way'=>0,'game_id'=>$data['game_id'],p=>1,row=>10]))}">{$data.balance_coin_count}</td>
data-url="{:U('FinancePromote/gameCoinDetail',array_merge(I('get.'),['pay_way'=>0,'game_id'=>$data['game_id'],p=>1,row=>10]))}">
<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('FinancePromote/gameCoinDetail',array_merge(I('get.'),['pay_way'=>-1,'game_id'=>$data['game_id'],p=>1,row=>10]))}"> <td class="coin-detail" data-pay_type="-1" style="color: #0066cc;cursor: pointer" data-url="{:U('FinancePromote/gameCoinDetail',array_merge(I('get.'),['pay_way'=>-1,'game_id'=>$data['game_id'],p=>1,row=>10]))}">
<if condition="$data.inside_cash_count neq ''">{$data.inside_cash_count}<else/>0</if></td> {$data.inside_cash_count}
<td ><if condition="$data.all_cash_count neq ''">{$data.all_cash_count}<else/>0</if></td> </td>
<td >{$data.all_cash_count}</td>
<td > <td >
<a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['game_id'=>$data['game_id'],'game_name'=>$data['game_name'],'promote_level'=>$promote_level]))}" >订单查看</a> <a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['game_id'=>$data['game_id'],'game_name'=>$data['game_name'],'promote_level'=>$promote_level]))}" >订单查看</a>
</td> </td>
@ -217,7 +205,7 @@
</div> </div>
</div> </div>
<div class="page"> <div class="page">
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}">导出</a>
{$_page|default=''} {$_page|default=''}
</div> </div>
</block> </block>
@ -257,7 +245,7 @@
}); });
$('.page a').click(function () { $('.page a:eq(1)').click(function () {
var href = $(this).attr('href'); var href = $(this).attr('href');
$(this).removeAttr('href'); $(this).removeAttr('href');
window.location.replace(href) window.location.replace(href)

@ -145,18 +145,6 @@
<a class="sch-btn" href="javascript:;" id="search" url="{:U('FinancePromote/gameStatisticsDetail','model='.$model['name'].'&row='.I('row'),false)}" <a class="sch-btn" href="javascript:;" id="search" url="{:U('FinancePromote/gameStatisticsDetail','model='.$model['name'].'&row='.I('row'),false)}"
style="">搜索</a> style="">搜索</a>
<if condition="$_GET['all'] neq 1">
<a class="sch-btn" href="{:U('Export/gameStatisticsDetail',
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>
</div> </div>
@ -233,7 +221,7 @@
</div> </div>
</div> </div>
<div class="page"> <div class="page">
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}">导出</a>
{$_page|default=''} {$_page|default=''}
</div> </div>
</block> </block>
@ -256,7 +244,7 @@
highlight_subnav('{:U("FinancePromote/index")}'); highlight_subnav('{:U("FinancePromote/index")}');
$(function(){ $(function(){
$('.page a').click(function () { $('.page a:eq(1)').click(function () {
var href = $(this).attr('href'); var href = $(this).attr('href');
$(this).removeAttr('href'); $(this).removeAttr('href');
window.location.replace(href) window.location.replace(href)

@ -231,7 +231,7 @@
</div> </div>
<div class="page"> <div class="page">
<a class="sch-btn" <a class="sch-btn"
href="{:U('Export/expUser',array_merge(['id'=>3,'xlsname'=>'玩家_玩家列表_'.(I('get.type')==2?'第三方玩家':'本站玩家')],I('get.')))}">导出</a> href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}">导出</a>
{$_page|default=''} {$_page|default=''}
</div> </div>
@ -299,7 +299,7 @@
window.location.replace(url); window.location.replace(url);
// window.location.href = url; // window.location.href = url;
}); });
$('.page a').click(function () { $('.page a:eq(1)').click(function () {
var href = $(this).attr('href'); var href = $(this).attr('href');
$(this).removeAttr('href'); $(this).removeAttr('href');
window.location.replace(href) window.location.replace(href)

Loading…
Cancel
Save