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

master
chenxiaojun 5 years ago
parent 47af5037b7
commit e7f9d1b6f3

@ -1822,7 +1822,7 @@ class QueryController extends BaseController
->field('sum(uc . recharge_count) count') ->field('sum(uc . recharge_count) count')
->where($spendMap) ->where($spendMap)
->buildSql(); ->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') $sqlTodayCost = M('user_play_data_count', 'tab_')->alias('uc')
->field('sum(uc . recharge_count) count') ->field('sum(uc . recharge_count) count')
->where($spendMap) ->where($spendMap)
@ -1856,7 +1856,7 @@ class QueryController extends BaseController
'promote_id' => $role['promote_id'], 'promote_id' => $role['promote_id'],
'promote_account' => $role['promote_account'], 'promote_account' => $role['promote_account'],
'sdk_version' => $role['sdk_version'], '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() public function achievement()
{ {
$time = I('time', date('Y - m - d')); $time = I('time', date('Y-m-d'));
if (!empty($time)) { if (!empty($time)) {
$defaultTime = $time; $defaultTime = $time;
} else { } else {
$defaultTime = date('Y - m - d', time()); $defaultTime = date('Y-m-d', time());
} }
$sdkVersion = I('sdk_version', 0); $sdkVersion = I('sdk_version', 0);
$gameId = I('game_id', 0); $gameId = I('game_id', 0);
@ -2003,14 +2003,14 @@ class QueryController extends BaseController
if (count($ids) > 0) { if (count($ids) > 0) {
$rows = M('promote', 'tab_') $rows = M('promote', 'tab_')
->field(['id', 'chain']) ->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(); ->select();
} }
$basicPromotes = []; $basicPromotes = [];
foreach ($ids as $id) { foreach ($ids as $id) {
foreach ($rows as $row) { foreach ($rows as $row) {
$needChain = $parent['chain'] . $parent['id'] . ' / ' . $id . ' / '; $needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/';
if (strpos($row['chain'], $needChain) !== false) { if (strpos($row['chain'], $needChain) !== false) {
$basicPromotes[$row['id']] = $id; $basicPromotes[$row['id']] = $id;
} }
@ -2135,11 +2135,11 @@ class QueryController extends BaseController
public function userPlayDataCount() 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_status'] = 1;
$spendMap['pay_game_status'] = 1; $spendMap['pay_game_status'] = 1;
$spendMap['game_player_id'] = ['gt', 0]; $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'; $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) $spendCostData = M('spend', 'tab_')->field($field)

@ -33,64 +33,63 @@
<span class="title_main">玩家充值</span> <span class="title_main">玩家充值</span>
</div> </div>
<div class="trunk-content article"> <div class="trunk-content article">
<div class="trunk-search clearfix"> <div class="trunk-search clearfix jssearch">
<form action="{:U('Query/userRecharges',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data"> <div class="form-group normal_space">
<div class="form-group normal_space"> <select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" > <option value="0">请选择游戏</option>
<option value="0">请选择游戏</option> <volist name="games" id="game">
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') === $game['game_id']">selected</if>>{$game.game_name}</option> <option value="{$game.game_id}" <if condition="I('game_id') === $game['game_id']">selected</if>>{$game.game_name}</option>
</volist> </volist>
</select> </select>
</div> </div>
<div class="form-group normal_space"> <div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}"> <select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option> <option value="0">请选择区服</option>
</select> </select>
</div> </div>
<div class="form-group normal_space"> <div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" > <select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option> <option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option> <option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option> <option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select> </select>
</div> </div>
<include file="Public/promote_select" /> <include file="Public/promote_select" />
<div class="form-group normal_space"> <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>
<div class="form-group normal_space"> <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>
<!-- <div class="form-group normal_space"> <!-- <div class="form-group normal_space">
<input type="text" name="device_sn" class="txt normal_txt" id="uid" placeholder="请输入设备号" value="{:I('device_sn')}"> <input type="text" name="device_sn" class="txt normal_txt" id="uid" placeholder="请输入设备号" value="{:I('device_sn')}">
</div> --> </div> -->
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<label>充值总额:</label> <label>充值总额:</label>
<input type="text" class="txt float-input" name="cost_begin" style="width: 50px" value="{:I('cost_begin')}" > <input type="text" class="txt float-input" name="cost_begin" style="width: 50px" value="{:I('cost_begin')}" >
<label> ~ </label> <label> ~ </label>
<input type="text" class="txt float-input" name="cost_end" style="width: 50px" value="{:I('cost_end')}" > <input type="text" class="txt float-input" name="cost_end" style="width: 50px" value="{:I('cost_end')}" >
</div> </div>
<div class="form-group normal_space fr" style="display: flex;"> <div class="form-group normal_space fr" style="display: flex;">
<label class="form-title select-title" style="position: relative;">充值时间:</label> <label class="form-title select-title" style="position: relative;">充值时间:</label>
<div class="select-time"> <div class="select-time">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}"> <input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</div>
<div class="form-group normal_space">
<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="查询">
</div> </div>
<div class="form-group normal_space"> <label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<label><input name="is_self" value="1" <if condition="I('is_self') == 1">checked</if> type="checkbox"> 本账号推广</label> <div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div> </div>
</form> </div>
<div class="form-group normal_space">
<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" 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>
</div> </div>
<div class="trunk-list list_normal"> <div class="trunk-list list_normal">
<table class="table normal_table"> <table class="table normal_table">
@ -196,8 +195,9 @@
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script> <script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script> <script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$(".select_gallery").select2(); setValue('row', '{:I("get.row",10)}');
$(".select_gallery").select2();
var date = "{$setdate}"; var date = "{$setdate}";
$('#sdate').datetimepicker({ $('#sdate').datetimepicker({
@ -264,8 +264,36 @@ $(function(){
sort = (sort === 1) ? 2 : 1; sort = (sort === 1) ? 2 : 1;
$('#sort').val(sort); $('#sort').val(sort);
$('#sort_name').val(sortName); $('#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> </script>
</block> </block>

@ -22,52 +22,51 @@
<span class="title_main">角色查询</span> <span class="title_main">角色查询</span>
</div> </div>
<div class="trunk-content article"> <div class="trunk-content article">
<div class="trunk-search clearfix"> <div class="trunk-search clearfix jssearch">
<form action="{:U('Query/userRoles',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data"> <div class="form-group normal_space">
<div class="form-group normal_space"> <select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" > <option value="0">请选择游戏</option>
<option value="0">请选择游戏</option> <volist name="games" id="game">
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') eq $game['game_id']">selected</if>>{$game.game_name}</option> <option value="{$game.game_id}" <if condition="I('game_id') eq $game['game_id']">selected</if>>{$game.game_name}</option>
</volist> </volist>
</select> </select>
</div> </div>
<div class="form-group normal_space"> <div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}"> <select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option> <option value="0">请选择区服</option>
</select> </select>
</div> </div>
<div class="form-group normal_space"> <div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" > <select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option> <option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option> <option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option> <option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select> </select>
</div> </div>
<include file="Public/promote_select" /> <include file="Public/promote_select" />
<div class="form-group normal_space"> <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" id="uid" placeholder="请输入角色名" value="{:I('role_name')}">
</div> </div>
<div class="form-group normal_space"> <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" id="uid" placeholder="请输入玩家账号" value="{:I('user_account')}">
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<label>创建时间:</label> <label>创建时间:</label>
<input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" > <input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" >
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<label>玩家等级:</label> <label>玩家等级:</label>
<input type="text" class="txt integer-input" name="role_level_begin" style="width: 50px" value="{:I('role_level_begin')}"> <input type="text" class="txt integer-input" name="role_level_begin" style="width: 50px" value="{:I('role_level_begin')}">
<label> ~ </label> <label> ~ </label>
<input type="text" class="txt integer-input" name="role_level_end" style="width: 50px" value="{:I('role_level_end')}" > <input type="text" class="txt integer-input" name="role_level_end" style="width: 50px" value="{:I('role_level_end')}" >
</div> </div>
<div class="form-group"> <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)}"
</div> value="查询">
<div class="form-group normal_space"> </div>
<label><input name="is_self" value="1" type="checkbox" <if condition="I('is_self') == 1">checked</if>> 本账号推广</label> <div class="form-group normal_space">
</div> <label><input name="is_self" value="1" type="checkbox" <if condition="I('is_self') == 1">checked</if>> 本账号推广</label>
</form> </div>
</div> </div>
<div class="trunk-list list_normal"> <div class="trunk-list list_normal">
<table class="table normal_table"> <table class="table normal_table">
@ -130,6 +129,8 @@
<script type="text/javascript" src="__JS__/common.js"></script> <script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
setValue('row', '{:I("get.row",10)}');
var defaultDate = $('.range-date').val() var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ') defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({ $('.range-date').flatpickr({
@ -171,6 +172,22 @@ $(function() {
var promoteUrl = "{:U('Query/getSubPromotes')}" var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl) 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> </script>
</block> </block>
Loading…
Cancel
Save