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
1ad003fd
authored
Mar 05, 2019
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化后台
parent
16161b5a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
5 deletions
app/Http/Controllers/MessageApiController.php
app/Http/Controllers/MessageController.php
public/.htaccess
resources/views/index.blade.php
resources/views/message/templatelist.blade.php
app/Http/Controllers/MessageApiController.php
View file @
1ad003fd
...
...
@@ -26,6 +26,24 @@ class MessageApiController extends Controller
exit
();
}
//删除消息模板
public
function
deletetemplate
(
$request
){
$data
=
$request
->
input
();
try
{
$tid
=
isset
(
$data
[
'id'
])
&&
$data
[
'id'
]
?
intval
(
$data
[
'id'
])
:
0
;
$cnt
=
DB
::
connection
(
'message'
);
$bk
=
$cnt
->
table
(
'lie_msg_tpl'
)
->
where
(
"tpl_id"
,
$tid
)
->
update
([
'status'
=>-
1
]);
if
(
$bk
){
$this
->
Export
(
0
,
''
);
}
else
{
throw
new
\Exception
(
'操作失败'
);
}
}
catch
(
\Exception
$e
){
$this
->
Export
(
1000
,
'操作失败'
);
}
}
//新增/编辑 消息模板
private
function
addTemplate
(
$request
)
{
...
...
app/Http/Controllers/MessageController.php
View file @
1ad003fd
...
...
@@ -184,6 +184,8 @@ class MessageController extends Controller
$template_create
=
$res_perm
[
'template_create'
];
$template_edit
=
$res_perm
[
'template_edit'
];
// $template_check = $template_create = $template_edit =true;
//搜索
$search_desc
=
$request
->
input
(
'search_desc'
);
$search_channel
=
$request
->
input
(
'search_channel'
);
...
...
@@ -194,7 +196,7 @@ class MessageController extends Controller
//1.首次进页面无搜索条件
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
);
$info
=
$cnt
->
table
(
'lie_msg_tpl'
)
->
where
(
"status"
,
'0'
)
->
where
(
'source_type'
,
'1'
)
->
orderBy
(
'tpl_id'
,
'desc'
)
->
paginate
(
20
);
$search_channel
=
0
;
$search_desc
=
''
;
}
else
//2.有搜索条件
...
...
@@ -202,10 +204,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
%"
)
->
where
(
'description'
,
'like'
,
"%
$search_keyword
%"
)
->
orderBy
(
'tpl_id'
,
'desc'
)
->
paginate
(
20
);
$info
=
$cnt
->
table
(
'lie_msg_tpl'
)
->
where
(
'source_type'
,
'1'
)
->
where
(
"status"
,
'0'
)
->
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
(
'description'
,
'like'
,
"%
$search_keyword
%"
)
->
where
(
'ex_str'
,
'like'
,
"%
$search_desc
%"
)
->
orderBy
(
'tpl_id'
,
'desc'
)
->
paginate
(
20
);
$info
=
$cnt
->
table
(
'lie_msg_tpl'
)
->
where
(
'source_type'
,
'1'
)
->
where
(
"status"
,
'0'
)
->
where
(
'channels'
,
'like'
,
"%
$search_channel
%"
)
->
where
(
'description'
,
'like'
,
"%
$search_keyword
%"
)
->
where
(
'ex_str'
,
'like'
,
"%
$search_desc
%"
)
->
orderBy
(
'tpl_id'
,
'desc'
)
->
paginate
(
20
);
}
}
...
...
@@ -237,6 +239,7 @@ class MessageController extends Controller
'微信通知'
,
'钉钉通知'
];
$data
=
[
'title'
=>
'asd'
,
'id'
=>
$id
,
...
...
public/.htaccess
0 → 100644
View file @
1ad003fd
<
IfModule
mod_rewrite.c
>
<
IfModule
mod_negotiation.c
>
Options
-MultiViews
</
IfModule
>
RewriteEngine
On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond
%{REQUEST_FILENAME} !-d
RewriteRule
^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond
%{REQUEST_FILENAME} !-d
RewriteCond
%{REQUEST_FILENAME} !-f
RewriteRule
^ index.php [L]
</
IfModule
>
<
IfModule
deflate_module
>
# 对js,html,xml,css,普通文本开启Gzip压缩
AddOutputFilterByType
DEFLATE application/x-javascript text/html text/plain text/xml text/css
</
IfModule
>
resources/views/index.blade.php
View file @
1ad003fd
...
...
@@ -3,7 +3,7 @@
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
资料
管理后台 | 首页
</title>
<title>
消息
管理后台 | 首页
</title>
{{--
<script>
document
.
domain
=
"{{ Config::get('website.domain') }}"
;
</script>
--}}
@include('table.css')
...
...
resources/views/message/templatelist.blade.php
View file @
1ad003fd
...
...
@@ -52,6 +52,7 @@
<tr
role=
"row"
>
<th
style=
"width:100px;"
class=
"text-center"
>
模板编号
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
模板标题
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
关键字
</th>
<th
style=
"width:150px;"
class=
"text-center"
>
消息描述
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
消息渠道
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
操作
</th>
...
...
@@ -63,10 +64,16 @@
<
tr
role=
"row"
style=
"text-align: center"
>
<td>
{{ $info[$i]->tpl_id }}
</td>
<td>
{{ $info[$i]->title }}
</td>
<td>
{{ $info[$i]->description }}
</td>
<td>
{{ $info[$i]->ex_str }}
</td>
<td>
{{ $info[$i]->show_channels_str }}
</td>
@if($template_edit)
<td><a
href=
"{{url('message/addtemplate')}}?tpl_id={{$info[$i]->tpl_id}}"
class=
"btn btn-xs btn-outline btn-primary"
>
编辑
</a></td>
<td>
<a
href=
"{{url('message/addtemplate')}}?tpl_id={{$info[$i]->tpl_id}}"
class=
"btn btn-xs btn-outline btn-primary"
>
编辑
</a>
<a
onclick=
"deletemlate({{$info[$i]->tpl_id}})"
href=
"#"
class=
"btn btn-xs btn-outline btn-primary"
>
删除
</a>
</td>
@endif
</tr>
@endfor
...
...
@@ -107,5 +114,26 @@
</div>
</div>
@endif
<script
src=
"/js/Message/layer/layer.js"
></script>
<script>
var
deletemplateurl
=
'{{url('
msgapi
/
deletetemplate
')}}'
;
function
deletemlate
(
id
){
layer
.
confirm
(
'确定删除?'
,
{
btn
:
[
'确定'
,
'取消'
]
//按钮
},
function
(){
$
.
post
(
deletemplateurl
,{
'id'
:
id
},
function
(
res
){
if
(
res
.
errcode
==
0
){
layer
.
msg
(
'删除成功'
,
{
icon
:
1
});
window
.
location
.
reload
();
}
else
{
layer
.
msg
(
'删除失败'
,
{
icon
:
1
});
}
},
'json'
);
},
function
(){
});
}
</script>
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