超级签统计--搜索修改

master
zhanglingsheng 5 years ago
parent 087a935c45
commit 3a3afa739c

@ -1983,8 +1983,17 @@ class ExportController extends Controller
array('promote_super_money', '推广超级签金额'),
array('official_super_money', '官方超级签金额'),
);
$params = I('get.');
if(isset($params['timestart']) && isset($params['timeend'])) {
$startTime = strtotime($params['timestart']);
$endTime = strtotime($params['timeend']) + 86399;
$map['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
}
if(isset($params['game_id'])) {
$map['tab_game.id'] = $params['game_id'];
}
$map['supersign_token'] = ['NEQ',''];
$supersign_game = M('game', 'tab_')->field('id,game_name,supersign_token')->where($map)->select();
$supersign_game = M('game', 'tab_')->field('tab_game.id,tab_game.game_name,tab_game.supersign_token')->join('tab_game_supersign on tab_game_supersign.game_id = tab_game.id')->where($map)->group('tab_game.id')->page($page,$row)->select();
$xlsData = [];
$count['authorization'] = 0;
$count['pay_num'] = 0;
@ -2012,15 +2021,22 @@ class ExportController extends Controller
}
}
$arr['authorization_num'] = count($re_data);
$game_supersign = M('game_supersign', 'tab_')->field('promote_id')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->where(['game_id' => $v['id'], 'pay_status' => 1])->select();
if(isset($params['timestart']) && isset($params['timeend'])) {
$startTime = strtotime($params['timestart']);
$endTime = strtotime($params['timeend']) + 86399;
$where['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
}
$where['game_id'] = $v['id'];
$where['pay_status'] = 1;
$game_supersign = M('game_supersign', 'tab_')->field('promote_id,pay_price')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->where($where)->select();
$arr['pay_game_supersign'] = count($game_supersign);
$arr['promote_super_money'] = 0;
$arr['official_super_money'] = 0;
foreach($game_supersign as $key => $val) {
if($val['promote_id'] != 0) {
$arr['promote_super_money'] += 10;
$arr['promote_super_money'] += $val['pay_price'];
}else {
$arr['official_super_money'] += 10;
$arr['official_super_money'] += $val['pay_price'];
}
}
$xlsData[] = $arr;
@ -2046,6 +2062,14 @@ class ExportController extends Controller
$map['tab_user.promote_id'] = ['in', $promoteIds];
}
}
if(isset($params['timestart']) && isset($params['timeend'])) {
$startTime = strtotime($params['timestart']);
$endTime = strtotime($params['timeend']) + 86399;
$map['tab_game_supersign.pay_time'] = array('BETWEEN', [$startTime, $endTime]);
}
if(isset($params['game_id'])) {
$map['tab_game_supersign.game_id'] = $params['game_id'];
}
$xlsCell = array(
array('order_id', '订单号'),
array('account', '游戏账号'),
@ -2066,8 +2090,21 @@ class ExportController extends Controller
array('buy_num', '超级签被购买数量'),
array('money_all', '超级签金额合计'),
);
$params = I('get.');
$startDate = empty($params['timestart']) ? '': $params['timestart'];
$endDate = empty($params['timeend']) ? '' : $params['timeend'];
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
if(!empty($startDate)) {
$where['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
$map['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
}
if(isset($params['game_id'])) {
$where['game_id'] = $params['game_id'];
$map['game_id'] = $params['game_id'];
}
$map['supersign_token'] = ['NEQ',''];
$supersign_game = M('game', 'tab_')->field('supersign_token')->where($map)->select();
$supersign_game = M('game', 'tab_')->field('tab_game.id,tab_game.game_name,tab_game.supersign_token')->join('tab_game_supersign on tab_game_supersign.game_id = tab_game.id')->where($map)->group('tab_game.id')->select();
$supersign_token = array_column($supersign_game, 'supersign_token');
$authorization_all_num = 0;
foreach($supersign_token as $k => $v) {
@ -2094,7 +2131,8 @@ class ExportController extends Controller
}
$where['pay_status'] = 1;
$xlsData[0]['buy_num'] = M('game_supersign', 'tab_')->where($where)->count();
$xlsData[0]['money_all'] = $xlsData[0]['buy_num'] * 10;
$pay_price = M('game_supersign', 'tab_')->field('sum(pay_price) as pay_price')->where($where)->select();
$xlsData[0]['money_all'] = $pay_price[0]['pay_price'] == '' ? 0 : $pay_price[0]['pay_price'];
$xlsData[0]['authorization_all_num'] = $authorization_all_num;
break;
case 25:

@ -5,7 +5,6 @@ namespace Admin\Controller;
class SuperStatisticalController extends ThinkController
{
private $super_money = 10;
private $ticketList_url = 'https://app.ipa365.com/Kirin/OpenApi/TicketList';
@ -18,12 +17,14 @@ class SuperStatisticalController extends ThinkController
if(!empty($startDate)) {
$where['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
$map['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
}
if(isset($params['game_id'])) {
$where['game_id'] = $params['game_id'];
$map['game_id'] = $params['game_id'];
}
$map['supersign_token'] = ['NEQ',''];
$supersign_game = M('game', 'tab_')->field('supersign_token')->where($map)->select();
$supersign_game = M('game', 'tab_')->field('id,game_name,supersign_token')->where(['supersign_token' => ['NEQ','']])->select();
$supersign_token = array_column($supersign_game, 'supersign_token');
$authorization_all_num = 0;
foreach($supersign_token as $k => $v) {
@ -31,7 +32,8 @@ class SuperStatisticalController extends ThinkController
}
$where['pay_status'] = 1;
$data['buy_num'] = M('game_supersign', 'tab_')->where($where)->count();
$data['money_all'] = $data['buy_num'] * $this->super_money;
$pay_price = M('game_supersign', 'tab_')->field('sum(pay_price) as pay_price')->where($where)->select();
$data['money_all'] = $pay_price[0]['pay_price'] == '' ? 0 : $pay_price[0]['pay_price'];
$data['authorization_all_num'] = $authorization_all_num;
$this->assign('data', $data);
$this->display('index');
@ -40,8 +42,17 @@ class SuperStatisticalController extends ThinkController
public function lists($p = 1,$row = 10) {
$page = $p ? $p : 1;
$row = $row ? $row : 10;
$params = I('get.');
if(isset($params['timestart']) && isset($params['timeend'])) {
$startTime = strtotime($params['timestart']);
$endTime = strtotime($params['timeend']) + 86399;
$map['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
}
if(isset($params['game_id'])) {
$map['tab_game.id'] = $params['game_id'];
}
$map['supersign_token'] = ['NEQ',''];
$supersign_game = M('game', 'tab_')->field('id,game_name,supersign_token')->where($map)->page($page,$row)->select();
$supersign_game = M('game', 'tab_')->field('tab_game.id,tab_game.game_name,tab_game.supersign_token')->join('tab_game_supersign on tab_game_supersign.game_id = tab_game.id')->where($map)->group('tab_game.id')->page($page,$row)->select();
$data = [];
$num['authorization'] = 0;
$num['pay_num'] = 0;
@ -51,7 +62,15 @@ class SuperStatisticalController extends ThinkController
$arr['game_name'] = $v['game_name'];
$arr['authorization_num'] = count($this->game_supersign_num($v['supersign_token']));
$num['authorization'] += $arr['authorization_num'];
$game_supersign = M('game_supersign', 'tab_')->field('promote_id')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->where(['game_id' => $v['id'], 'pay_status' => 1])->select();
if(isset($params['timestart']) && isset($params['timeend'])) {
$startTime = strtotime($params['timestart']);
$endTime = strtotime($params['timeend']) + 86399;
$where['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
}
$where['game_id'] = $v['id'];
$where['pay_status'] = 1;
$game_supersign = M('game_supersign', 'tab_')->field('promote_id,pay_price')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->where($where)->select();
$arr['pay_game_supersign'] = count($game_supersign);
$num['pay_num'] += $arr['pay_game_supersign'];
@ -59,16 +78,16 @@ class SuperStatisticalController extends ThinkController
$arr['official_super_money'] = 0;
foreach($game_supersign as $key => $val) {
if($val['promote_id'] != 0) {
$arr['promote_super_money'] += $this->super_money;
$arr['promote_super_money'] += $val['pay_price'];
}else {
$arr['official_super_money'] += $this->super_money;
$arr['official_super_money'] += $val['pay_price'];
}
}
$num['official_super_money'] += $arr['official_super_money'];
$num['promote_super_money'] += $arr['promote_super_money'];
$data[] = $arr;
}
$count = M('game', 'tab_')->where($map)->count();
$count = count(M('game', 'tab_')->field('tab_game.id,tab_game.game_name,tab_game.supersign_token')->join('tab_game_supersign on tab_game_supersign.game_id = tab_game.id')->where($map)->group('tab_game.id')->select());
$page = set_pagination($count, $row);
$this->assign('_page', $page);
$this->assign('data', $data);
@ -121,14 +140,20 @@ class SuperStatisticalController extends ThinkController
$map['tab_user.promote_id'] = ['in', $promoteIds];
}
}
$data = M('game_supersign', 'tab_')->field('tab_game_supersign.id,tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where($map)->page($page,$row)->order('id DESC')->select();
if(isset($params['timestart']) && isset($params['timeend'])) {
$startTime = strtotime($params['timestart']);
$endTime = strtotime($params['timeend']) + 86399;
$map['tab_game_supersign.pay_time'] = array('BETWEEN', [$startTime, $endTime]);
}
if(isset($params['game_id'])) {
$map['tab_game_supersign.game_id'] = $params['game_id'];
}
$data = M('game_supersign', 'tab_')->field('tab_game_supersign.id,tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time,tab_game_supersign.pay_price')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where($map)->page($page,$row)->order('id DESC')->select();
$count = M('game_supersign', 'tab_')->field('tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where($map)->count();
$super_money_all = $count * $this->super_money;
$page = set_pagination($count, $row);
$this->assign('_page', $page);
$this->assign('data', $data);
$this->assign('super_money', $this->super_money);
$this->assign('super_money_all', $super_money_all);
$this->display('superDetail');
}

@ -137,6 +137,19 @@
//导航高亮
highlight_subnav('{:U('SuperStatistical/index')}');
$(function () {
params = ''
var time_start = $("#time-start").val()
var time_end = $("#time-end").val()
var game_name = $("#game_name").val()
if(time_start != '') {
params = params + '/timestart/' + time_start
}
if(time_end != '') {
params = params + '/timeend/' + time_end
}
if(game_name != '') {
params = params + '/game_id/' + game_name
}
$("#role").click(function () {
layer.open({
type: 2,
@ -144,7 +157,7 @@
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: ['admin.php?s=/SuperStatistical/lists' , 'no']
content: ['admin.php?s=/SuperStatistical/lists' + params , 'no']
});
});
$("#role1").click(function () {
@ -154,7 +167,7 @@
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: ['admin.php?s=/SuperStatistical/lists' , 'no']
content: ['admin.php?s=/SuperStatistical/lists' + params , 'no']
});
});
$("#superDetail").click(function () {
@ -164,7 +177,7 @@
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: ['admin.php?s=/SuperStatistical/superDetail' , 'no']
content: ['admin.php?s=/SuperStatistical/superDetail' + params , 'no']
});
});
//搜索功能

@ -11,13 +11,35 @@
<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">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css"/>
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
</head>
<style>
body {
padding: 0px;
}
.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;}
</style>
<body>
<div id="main" class="main" style="min-height: 342px;width: 92.5%;">
@ -25,7 +47,34 @@
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list">
<input type="text" readonly id="time-start" name="timestart" class="" value="{:I('get.timestart')}"
placeholder="开始时间"/>
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time-end" name="timeend" class="" value="{:I('get.timeend')}"
placeholder="结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-game search_label_rehab" >
<select id="game_name" name="game_id" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllIosGame()" id="vo">
<option value="{$vo.id}" <?php echo $vo['id'] == I('game_id') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list search_item">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('SuperStatistical/lists','model='.$model['name'] . '&row='.I('row'),false)}">搜索</a>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list box_mt">
<div class="">
@ -68,4 +117,103 @@
</div>
</div>
</body>
<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 src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script>
<volist name = ":I('get.')" id = "vo">
Think.setValue('{$key}', "{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
$(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;
}
var start = $("#time_start").val();
var end = $("#time_end").val();
if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
window.location.href = url;
});
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var end = new Date($.trim($('#time-end').val())).getTime();
if (val>end) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$("#time-end").datetimepicker({
format:"yyyy-mm-dd",
language: "zh-CN",
showMeridian:true,
minView:2,
autoclose:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var start = new Date($.trim($('#time-start').val())).getTime();
if (val<start) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
var promote_id = "{:I('promote_id')}";
$("#promote_level").change(function(){
$.ajax({
url:"{:U('Ajax/getPromotersByLevel')}",
type:"get",
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option><option value="UC"'+(promote_id && 'UC' == promote_id?'selected':'')+'>UC渠道</option>';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';
// });
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"
}
$("#promote_id").empty();
$("#promote_id").append(str);
$("#promote_id").select2();
}
})
});
$("#promote_level").change();
})
</script>
</html>

@ -76,6 +76,23 @@
<option value="UC" <?php if ($_POST['promote_id'] == 'UC'):?>selected<?php endif;?>>UC用户</option>
</select>
</div>
<div class="input-list">
<input type="text" readonly id="time-start" name="timestart" class="" value="{:I('get.timestart')}"
placeholder="开始时间"/>
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time-end" name="timeend" class="" value="{:I('get.timeend')}"
placeholder="结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_id" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllIosGame()" id="vo">
<option value="{$vo.id}" <?php echo $vo['id'] == I('game_id') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list search_item">
@ -109,7 +126,7 @@
<td>{$vo.device_number}</td>
<td>{$vo.game_name}</td>
<td>{$vo.pay_time|date='Y-m-d H:i:s',###}</td>
<td>{$super_money}</td>
<td>{$vo.pay_price}</td>
</tr>
</volist>
<tr>
@ -131,6 +148,22 @@
</div>
</div>
</body>
<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 src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script>
<volist name = ":I('get.')" id = "vo">
Think.setValue('{$key}', "{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
$(function(){
$(".select_gallery").select2();
@ -154,6 +187,39 @@
}
}
window.location.href = url;
});
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var end = new Date($.trim($('#time-end').val())).getTime();
if (val>end) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$("#time-end").datetimepicker({
format:"yyyy-mm-dd",
language: "zh-CN",
showMeridian:true,
minView:2,
autoclose:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var start = new Date($.trim($('#time-start').val())).getTime();
if (val<start) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
var promote_id = "{:I('promote_id')}";
$("#promote_level").change(function(){

Loading…
Cancel
Save