Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李洋
/
消息系统
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
904437e4
authored
Jul 05, 2018
by
lfc
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加消息关键词keyword的筛选
parent
85a5f553
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
app/Http/Controllers/MessageController.php
public/js/Message/templatelist.js
resources/views/message/templatelist.blade.php
app/Http/Controllers/MessageController.php
View file @
904437e4
...
...
@@ -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
,
...
...
public/js/Message/templatelist.js
View file @
904437e4
//指定条件搜索
$
(
'#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
resources/views/message/templatelist.blade.php
View file @
904437e4
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment