角色查询新增创角时间区间查询

master
chenzhi 5 years ago
parent 6ad8154832
commit 70aab2f137

@ -646,6 +646,15 @@ class UserController extends AdminController
$map['sdk_version'] = trim($_REQUEST['game_type']);
unset($_REQUEST['game_type']);
}
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$map['create_time'] = ['between', [strtotime(I('time_start')), strtotime(I('time_end')) + 86399]];
} elseif (isset($_REQUEST['time_start'])) {
$map['create_time'] = ['GT', strtotime(I('time_start'))];
} elseif (isset($_REQUEST['time_end'])) {
$map['create_time'] = ['LT', strtotime(I('time_end')) + 86399];
}
empty(I('user_account')) || $map['user_account'] = ['like', "%" . I('user_account') . "%"];
$list = $this->lists(M('user_play_info', 'tab_'), $map, 'play_time desc');
$this->assign('list', $list);

@ -4,6 +4,7 @@
<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>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
@ -95,6 +96,14 @@
<option value="0" <?php if ($_POST['promote_id'] == 0):?>selected<?php endif;?>>官方渠道</option>
<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="time_start" class="" value="{:I('time_start')}" placeholder="创角开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time_end" name="time_end" class="" value="{:I('time_end')}" placeholder="创角结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('rolelist',array('row'=>I('row')))}">搜索</a>
@ -180,7 +189,13 @@
</volist>
$(".select_gallery").select2();
</script>
<script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
<script src="__STATIC__/thinkbox/jquery.thinkbox.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 type="text/javascript">
//搜索功能
$("#search").click(function(){
@ -193,6 +208,14 @@ $(".select_gallery").select2();
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;
});
@ -224,7 +247,22 @@ $(".select_gallery").select2();
$("#game_id").change(function(){
get_sever($(this).find("option:selected").attr('game-id'));
})
//时间
$('#time_start').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true,
pickerPosition:'bottom-left'
})
function get_sever(game_id){
//var game_id = game_id;//$("this").find("option:selected").attr('game-id');
if(!game_id) {return;}

Loading…
Cancel
Save