Merge pull request '版本更新' (#285) from release into master
Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/285master
commit
56e28d216e
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace Admin\Controller;
|
||||
|
||||
class RechargeSumOtherController extends ThinkController
|
||||
{
|
||||
|
||||
public function summation($p = 1)
|
||||
{
|
||||
|
||||
$startDateTime = empty($_REQUEST['timeStart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timeStart'];
|
||||
$endDateTime = empty($_REQUEST['timeEnd']) ? date('Y-m-d') : $_REQUEST['timeEnd'];
|
||||
$_GET['timeStart'] = $startDateTime;
|
||||
$_GET['timeEnd'] = $endDateTime;
|
||||
|
||||
if(!array_key_exists("timeStart",$_REQUEST)){
|
||||
$this->redirect(ACTION_NAME, array('timeStart' => date('Y-m-d',strtotime('-7 day')),"timeEnd"=>date('Y-m-d')));
|
||||
}
|
||||
|
||||
$total = ['current' => 0, 'sum' => 0];
|
||||
$map['date'] = array('BETWEEN', array($startDateTime, $endDateTime));
|
||||
|
||||
$_REQUEST['game_name'] ? ($map['game_name'] = $_REQUEST['game_name']) :'';
|
||||
|
||||
$data = M("recharge_text","tab_")->where($map)->order("date desc")->select();
|
||||
|
||||
if (isset($_REQUEST['row'])) {
|
||||
$row = $_REQUEST['row'];
|
||||
} else {
|
||||
$row = 10;
|
||||
}
|
||||
foreach ($data as $k => $v) {
|
||||
$total['sum'] += $v['day_pay'];
|
||||
}
|
||||
$count = count($data);
|
||||
$export_data = $data;
|
||||
$page = set_pagination($count, $row);
|
||||
if ($page) {
|
||||
$this->assign('_page', $page);
|
||||
}
|
||||
//用array_slice(array,offset,length) 函数在数组中根据条件取出一段值;array(数组),offset(元素的开始位置),length(组的长度)
|
||||
$data = array_slice($data, ($p - 1) * $row, $row);
|
||||
|
||||
foreach ($data as $k => $v) {
|
||||
$total['current'] += $v['day_pay'];
|
||||
}
|
||||
|
||||
|
||||
//判断是否执行导出
|
||||
if (I('export') == 1) {
|
||||
//操作日志
|
||||
$GetData = $_GET;
|
||||
unset($GetData['xlsname']);
|
||||
unset($GetData['export']);
|
||||
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U('RechargeSum/summation',$GetData),'menu'=>'充值-游戏订单-充值汇总-导出']);
|
||||
|
||||
$this->exportSum($export_data);
|
||||
}
|
||||
|
||||
$this->assign('showPromote', session('user_auth')['show_promote']);
|
||||
$this->assign('meta_title', "充值汇总");
|
||||
$this->assign('list_data', $data);
|
||||
$this->assign('total', $total);
|
||||
$this->assign('startDate', $startDateTime);
|
||||
$this->assign('endDate', $endDateTime);
|
||||
$this->assign("is_admin",is_administrator());
|
||||
$this->m_title = '充值汇总';
|
||||
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'RechargeSum/summation', 'status' => 1])->find());
|
||||
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function exportSum($data)
|
||||
{
|
||||
$export = A('Export');
|
||||
$exptitle = $_REQUEST['xlsname'];
|
||||
$expCellName = array(
|
||||
array('date', '日期'),
|
||||
array('from_channel', '渠道来源'),
|
||||
array('game_name', '游戏名称'),
|
||||
array('new_person', '新增人数'),
|
||||
array('active_person', '活跃人数'),
|
||||
array('new_pay_person', "新增玩家付费"),
|
||||
array('day_pay', '本日累计'),
|
||||
);
|
||||
if (session('user_auth')['show_promote'] == 0) {
|
||||
foreach ($expCellName as $key => $row) {
|
||||
if ($row[0] == 'promote_id') {
|
||||
unset($expCellName[$key]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$expCellName = array_values($expCellName);
|
||||
}
|
||||
$expTableData = $data;
|
||||
$export->exportExcel($exptitle, $expCellName, $expTableData);
|
||||
}
|
||||
}
|
@ -0,0 +1,202 @@
|
||||
<extend name="Public/base"/>
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
|
||||
height:28px;border-radius:3px;font-size:12px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
|
||||
.tooltip {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
color: #056dae;
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext {
|
||||
visibility: hidden;
|
||||
width: 250%;
|
||||
background-color: #fff;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 0;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 80%;
|
||||
left: 0;
|
||||
margin-left: -70%;
|
||||
border: #000 solid 1px;
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: black transparent transparent transparent;
|
||||
}
|
||||
|
||||
.tooltip:hover .tooltiptext {
|
||||
|
||||
color: #000;
|
||||
visibility: visible;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
|
||||
<h3 class="page_title">退款统计</h3>
|
||||
<p class="description_text"></p>
|
||||
</div>
|
||||
|
||||
<div class="cf top_nav_list">
|
||||
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list">
|
||||
<!--游戏类型搜索END-->
|
||||
|
||||
<div class="input-list input-list-promote search_label_rehab">
|
||||
<select id="count_date" name="count_date" class="select_gallery" style="width:150px;">
|
||||
<option value="">请选择月份</option>
|
||||
<volist name="date_count" id="vo">
|
||||
<option value="{$vo}" <if condition="$vo eq $_GET['count_date']">selected=selected</if>>{$vo}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
<input style="width: 200px;" type="text" name="user_account" class="search-input" value="{:I('user_account')}" placeholder="请输入玩家账号">
|
||||
</div>
|
||||
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="{:U('userCount','model='.$model['name'].'&row='.I('row'),false)}"
|
||||
style="width: 100px;border: #3C95C8 solid 1px;">搜索</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 数据列表 -->
|
||||
<div class="data_list">
|
||||
<empty name="show_status">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th >月份</th>
|
||||
<th >玩家账号</th>
|
||||
<th >退款金额</th>
|
||||
<th >操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<style>
|
||||
.data-table thead th, .data-table tbody td{text-align:center}
|
||||
.data-table tbody td{border-right:1px solid #DDDDDD;}
|
||||
.d_list .drop-down ul {z-index:999;}
|
||||
</style>
|
||||
<if condition = "empty($data)">
|
||||
<tr>
|
||||
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
<notemtpy name = "data">
|
||||
<volist name="data" id="data">
|
||||
<tr>
|
||||
<td >{$data.month}</td>
|
||||
<td >{$data.user_account}</td>
|
||||
<td >{$data.refund_amount}</td>
|
||||
<td >
|
||||
<a href="{$data['jump_url']}" >查看</a>
|
||||
</td>
|
||||
</tr>
|
||||
</volist>
|
||||
<tr>
|
||||
<td><span>汇总</span></td>
|
||||
<td colspan="13" style="text-align: left;">累计退款: {$allcount|default=0}</td>
|
||||
</tr>
|
||||
</notemtpy>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</empty>
|
||||
</div>
|
||||
<div class="page">
|
||||
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
|
||||
{$_page|default=''}
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script>
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
|
||||
<script>
|
||||
<volist name=":I('get.')" id="vo">
|
||||
Think.setValue('{$key}',"{$vo}");
|
||||
</volist>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav("{:U('userCount')}");
|
||||
$(function(){
|
||||
$(".select_gallery").select2();
|
||||
|
||||
//搜索功能
|
||||
$("#search").click(function(){
|
||||
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.location.href = url;
|
||||
});
|
||||
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
</block>
|
Loading…
Reference in New Issue