推广补链新增一系列查询条件

master
chenzhi 5 years ago
parent 1649cd1e80
commit 3d672db381

@ -35,6 +35,7 @@ class MendController extends ThinkController {
* 补链记录
* @param integer $p 分页
* @param booble IS_POST post请求时为下一页ajax请求
* @param booble export 是否导出
* @return void
*/
public function recordList($p=1,$export=false)
@ -46,13 +47,18 @@ class MendController extends ThinkController {
} else {
$row = 10;
}
if(isset($_REQUEST['account'])){
if ($_REQUEST['account']=='全部') {
unset($_REQUEST['account']);
}
$map['user_account']=array('like','%'.$_REQUEST['account'].'%');
unset($_REQUEST['account']);
if(isset($_REQUEST['account'])) $map['user_account']=array('like','%'.$_REQUEST['account'].'%');
if(isset($_REQUEST['promote_account'])) $map['promote_account']=array('like','%'.$_REQUEST['promote_account'].'%');
if(isset($_REQUEST['promote_account_to'])) $map['promote_account_to']=array('like','%'.$_REQUEST['promote_account_to'].'%');
if(isset($_REQUEST['op_account'])) $map['op_account']=array('like','%'.$_REQUEST['op_account'].'%');
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$map['order_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]];
} elseif (isset($_REQUEST['time_start'])) {
$map['order_time'] = ['GT', strtotime($_REQUEST['time_start'])];
} elseif (isset($_REQUEST['time_end'])) {
$map['order_time'] = ['LT', strtotime($_REQUEST['time_end']) + 86399];
}
$data = M("Mend","tab_")
->field("user_account,promote_account,promote_account_to,order_time,create_time,op_account,remark")
->where($map)

@ -33,9 +33,27 @@
<div class="input-list">
<input type="text" name="account" placeholder="玩家账号" value="{:I('account')}">
</div>
<div class="input-list">
<input type="text" name="promote_account" placeholder="补链前渠道" value="{:I('promote_account')}">
</div>
<div class="input-list">
<input type="text" name="promote_account_to" placeholder="补链后渠道" value="{:I('promote_account_to')}">
</div>
<div class="input-list">
<input type="text" name="op_account" placeholder="操作人员" value="{:I('op_account')}">
</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('Mend/recordList','model='.$model['name'] . '&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
@ -159,6 +177,14 @@ $(function(){
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;
});
@ -169,7 +195,7 @@ $(function(){
$("#search").click();
}
});
$('#time-start').datetimepicker({
$('#time_start').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,

Loading…
Cancel
Save