Commit 904437e4 by lfc

添加消息关键词keyword的筛选

parent 85a5f553
......@@ -185,11 +185,12 @@ class MessageController extends Controller
//搜索
$search_desc = $request->input('search_desc');
$search_channel = $request->input('search_channel');
$search_keyword = $request->input('search_keyword');
$cnt = DB::connection('message');
//自动发送模板数据
//1.首次进页面无搜索条件
if($search_desc==null && $search_channel==null)
if($search_desc==null && $search_channel==null && $search_keyword == null)
{
$info = $cnt->table('lie_msg_tpl')->where('source_type','1')->orderBy('tpl_id','desc')->paginate(20);
$search_channel = 0;
......@@ -199,10 +200,10 @@ class MessageController extends Controller
//渠道里没有0,所以如果没选,将此条件剔除掉
if(0==$search_channel)
{
$info = $cnt->table('lie_msg_tpl')->where('source_type','1')->where('ex_str','like',"%$search_desc%")->orderBy('tpl_id','desc')->paginate(20);
$info = $cnt->table('lie_msg_tpl')->where('source_type','1')->where('ex_str','like',"%$search_desc%")->where('description','like',"%$search_keyword%")->orderBy('tpl_id','desc')->paginate(20);
}else
{
$info = $cnt->table('lie_msg_tpl')->where('source_type','1')->where('channels','like',"%$search_channel%")->where('ex_str','like',"%$search_desc%")->orderBy('tpl_id','desc')->paginate(20);
$info = $cnt->table('lie_msg_tpl')->where('source_type','1')->where('channels','like',"%$search_channel%")->where('description','like',"%$search_keyword%")->where('ex_str','like',"%$search_desc%")->orderBy('tpl_id','desc')->paginate(20);
}
}
......@@ -241,6 +242,7 @@ class MessageController extends Controller
'msg_channels'=>$msg_channels,
'search_desc'=>$search_desc,
'search_channel'=>$search_channel,
'search_keyword'=>$search_keyword,
'template_check'=>$template_check,
'template_create'=>$template_create,
......
//指定条件搜索
$('#search-btn').click(function () {
var search_desc = $('#search-desc').val();
var search_keyword = $('#search-keyword').val();
var search_channel = $('#choose-tpl option:selected').val();
window.location.href="/message/templatelist?search_desc="+search_desc+"&search_channel="+search_channel;
window.location.href="/message/templatelist?search_desc="+search_desc+"&search_channel="+search_channel + "&search_keyword=" + search_keyword;
})
\ No newline at end of file
......@@ -26,7 +26,8 @@
@if($template_create)
<a class="btn btn-primary btn-sm" href="/message/addtemplate" style="float: left; margin-left: 30px">新增消息模板</a>
@endif
<label>消息关键词(开发使用):</label>
<input type="text" class="form-control" id="search-keyword" placeholder="请输入消息关键词" value="{{ $search_keyword }}">
<label>消息描述:</label>
<input type="text" class="form-control" id="search-desc" placeholder="请输入消息描述" value="{{ $search_desc }}">
<label>消息渠道:</label>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment