推广平台->数据汇总--bug更新

master
chenxiaojun 5 years ago
parent 47af5037b7
commit e7f9d1b6f3

@ -1822,7 +1822,7 @@ class QueryController extends BaseController
->field('sum(uc . recharge_count) count')
->where($spendMap)
->buildSql();
$spendMap['uc . create_time'] = ['between', [strtotime(date('Y - m - d 00:00:00')), strtotime(date('Y - m - d 23:59:59'))]];
$spendMap['uc . create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]];
$sqlTodayCost = M('user_play_data_count', 'tab_')->alias('uc')
->field('sum(uc . recharge_count) count')
->where($spendMap)
@ -1856,7 +1856,7 @@ class QueryController extends BaseController
'promote_id' => $role['promote_id'],
'promote_account' => $role['promote_account'],
'sdk_version' => $role['sdk_version'],
'unlogin_day' => intval((strtotime(date('Y - m - d 00:00:00')) - strtotime(date('Y - m - d 00:00:00', $role['play_time']))) / (24 * 3600))
'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24 * 3600))
];
}
}
@ -1954,11 +1954,11 @@ class QueryController extends BaseController
public function achievement()
{
$time = I('time', date('Y - m - d'));
$time = I('time', date('Y-m-d'));
if (!empty($time)) {
$defaultTime = $time;
} else {
$defaultTime = date('Y - m - d', time());
$defaultTime = date('Y-m-d', time());
}
$sdkVersion = I('sdk_version', 0);
$gameId = I('game_id', 0);
@ -2003,14 +2003,14 @@ class QueryController extends BaseController
if (count($ids) > 0) {
$rows = M('promote', 'tab_')
->field(['id', 'chain'])
->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . ' /%']], 'level' => ['gt', $parent['level'] + 1]])
->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]])
->select();
}
$basicPromotes = [];
foreach ($ids as $id) {
foreach ($rows as $row) {
$needChain = $parent['chain'] . $parent['id'] . ' / ' . $id . ' / ';
$needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/';
if (strpos($row['chain'], $needChain) !== false) {
$basicPromotes[$row['id']] = $id;
}
@ -2135,11 +2135,11 @@ class QueryController extends BaseController
public function userPlayDataCount()
{
$time = strtotime(date('Y - m - d 00:00:00', time() - (3600 * 24)));
$time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24)));
$spendMap['pay_status'] = 1;
$spendMap['pay_game_status'] = 1;
$spendMap['game_player_id'] = ['gt', 0];
$spendMap['pay_time'] = ['between', [$time, strtotime(date('Y - m - d 23:59:59', $time))]];
$spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]];
$field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count';
$spendCostData = M('spend', 'tab_')->field($field)

@ -33,8 +33,7 @@
<span class="title_main">玩家充值</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/userRecharges',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<div class="trunk-search clearfix jssearch">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
@ -57,10 +56,10 @@
</div>
<include file="Public/promote_select" />
<div class="form-group normal_space">
<input type="text" name="role_name" class="txt normal_txt" id="uid" placeholder="请输入角色名" value="{:I('role_name')}">
<input type="text" name="role_name" class="txt normal_txt" placeholder="请输入角色名" value="{:I('role_name')}">
</div>
<div class="form-group normal_space">
<input type="text" name="user_account" class="txt normal_txt" id="uid" placeholder="请输入玩家账号" value="{:I('user_account')}">
<input type="text" name="user_account" class="txt normal_txt" placeholder="请输入玩家账号" value="{:I('user_account')}">
</div>
<!-- <div class="form-group normal_space">
<input type="text" name="device_sn" class="txt normal_txt" id="uid" placeholder="请输入设备号" value="{:I('device_sn')}">
@ -85,12 +84,12 @@
<input type="hidden" name="last_sort_name" id="last_sort_name" value="{:I('sort_name', '')}">
<input type="hidden" name="sort_name" id="sort_name" value="{:I('sort_name', '')}">
<input type="hidden" name="sort" id="sort" value="{$sort}">
<input type="submit" class="submit" value="查询">
<input type="submit" class="submit" id='submit' url="{:U('Query/userRecharges','model='.$model['name'],false)}"
value="查询">
</div>
<div class="form-group normal_space">
<label><input name="is_self" value="1" <if condition="I('is_self') == 1">checked</if> type="checkbox"> 本账号推广</label>
</div>
</form>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
@ -197,6 +196,7 @@
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
$(function(){
setValue('row', '{:I("get.row",10)}');
$(".select_gallery").select2();
var date = "{$setdate}";
@ -264,7 +264,35 @@ $(function(){
sort = (sort === 1) ? 2 : 1;
$('#sort').val(sort);
$('#sort_name').val(sortName);
$('form').trigger('submit');
$('#submit').trigger('click');
});
$('#submit').click(function () {
var sdate = Date.parse($('#sdate').val()) / 1000;
var edate = Date.parse($('#edate').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if ((edate - sdate) > 2592000) {
layer.msg('时间间隔不能超过31天请重新选择日期');
return false;
}
var url = $(this).attr('url');
console.log(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;
});
})
</script>

@ -22,8 +22,7 @@
<span class="title_main">角色查询</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/userRoles',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<div class="trunk-search clearfix jssearch">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
@ -62,12 +61,12 @@
<input type="text" class="txt integer-input" name="role_level_end" style="width: 50px" value="{:I('role_level_end')}" >
</div>
<div class="form-group">
<input type="submit" class="submit normal_space" value="查询">
<input type="submit" class="submit" id='submit' url="{:U('Query/userRoles','model='.$model['name'],false)}"
value="查询">
</div>
<div class="form-group normal_space">
<label><input name="is_self" value="1" type="checkbox" <if condition="I('is_self') == 1">checked</if>> 本账号推广</label>
</div>
</form>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
@ -130,6 +129,8 @@
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
$(function() {
setValue('row', '{:I("get.row",10)}');
var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({
@ -171,6 +172,22 @@ $(function() {
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)
$('#submit').click(function () {
var url = $(this).attr('url');
console.log(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;
});
})
</script>
</block>
Loading…
Cancel
Save