客户模块,联系人列表新增搜索功能
This commit is contained in:
parent
2a3f1c5dce
commit
8476f2f9ac
@ -25,7 +25,7 @@ class Contact extends BaseController
|
||||
$where = array();
|
||||
$whereOr = array();
|
||||
if (!empty($param['keywords'])) {
|
||||
$where[] = ['a.id|a.name', 'like', '%' . $param['keywords'] . '%'];
|
||||
$where[] = ['a.id|a.name|a.mobile|c.name', 'like', '%' . $param['keywords'] . '%'];
|
||||
}
|
||||
$where[] = ['a.delete_time', '=', 0];
|
||||
|
||||
|
@ -2,6 +2,13 @@
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-x border-t">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="hidden" name="tab" value="0" />
|
||||
<input type="text" name="keywords" placeholder="输入关键字" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">提交搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="test" lay-filter="test"></table>
|
||||
</div>
|
||||
{/block}
|
||||
@ -84,6 +91,19 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(webform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
Loading…
x
Reference in New Issue
Block a user