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
26db6e8a
authored
Apr 26, 2019
by
李洋
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
消息模板分类
parent
9438ddbd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
78 additions
and
139 deletions
app/Http/Controllers/MessageApiController.php
app/Http/Controllers/MessageController.php
app/Providers/AppServiceProvider.php
public/js/Message/addclassify.js
public/js/Message/addtemplate.js
public/js/Message/allhistorylist.js
public/js/Message/templatelist.js
resources/views/message/addclassify.blade.php
resources/views/message/addtemplate.blade.php
resources/views/message/allhistorylist.blade.php
resources/views/message/templatelist.blade.php
app/Http/Controllers/MessageApiController.php
View file @
26db6e8a
This diff is collapsed.
Click to expand it.
app/Http/Controllers/MessageController.php
View file @
26db6e8a
This diff is collapsed.
Click to expand it.
app/Providers/AppServiceProvider.php
View file @
26db6e8a
...
@@ -16,8 +16,7 @@ class AppServiceProvider extends ServiceProvider
...
@@ -16,8 +16,7 @@ class AppServiceProvider extends ServiceProvider
{
{
//
//
//sql调试
//sql调试
$sql_debug
=
config
(
'database.sql_debug'
);
if
(
config
(
'database.sql_debug'
))
{
if
(
$sql_debug
)
{
DB
::
listen
(
function
(
$sql
)
{
DB
::
listen
(
function
(
$sql
)
{
foreach
(
$sql
->
bindings
as
$i
=>
$binding
)
{
foreach
(
$sql
->
bindings
as
$i
=>
$binding
)
{
if
(
$binding
instanceof
\DateTime
)
{
if
(
$binding
instanceof
\DateTime
)
{
...
@@ -30,7 +29,7 @@ class AppServiceProvider extends ServiceProvider
...
@@ -30,7 +29,7 @@ class AppServiceProvider extends ServiceProvider
}
}
$query
=
str_replace
(
array
(
'%'
,
'?'
),
array
(
'%%'
,
'%s'
),
$sql
->
sql
);
$query
=
str_replace
(
array
(
'%'
,
'?'
),
array
(
'%%'
,
'%s'
),
$sql
->
sql
);
$query
=
vsprintf
(
$query
,
$sql
->
bindings
);
$query
=
vsprintf
(
$query
,
$sql
->
bindings
);
print_r
(
$query
);
dd
(
$query
);
echo
'<br />'
;
echo
'<br />'
;
});
});
}
}
...
...
public/js/Message/addclassify.js
View file @
26db6e8a
...
@@ -6,31 +6,19 @@ layui.use('form', function(){
...
@@ -6,31 +6,19 @@ layui.use('form', function(){
showOrHide
(
data
.
value
);
showOrHide
(
data
.
value
);
});
});
// form.on('select(sel_add_classify)', function (data) {
// console.log(data.value);
// });
// form.on('select(sel_edit_classify)', function (data) {
// console.log(data.value);
// });
// form.on('select(sel_edit_sub_classify)', function (data) {
// console.log(data.value);
// });
//监听模板分类选择 并刷新二级分类数据
//监听模板分类选择 并刷新二级分类数据
form
.
on
(
'select(sel_edit_classify
_2nd
)'
,
function
(
data
){
form
.
on
(
'select(sel_edit_classify)'
,
function
(
data
){
var
sel_
msg_tpl
_cls
=
data
.
value
;
var
sel_
edit
_cls
=
data
.
value
;
$
.
ajax
({
$
.
ajax
({
url
:
"/msgapi/getSubTplCls"
,
url
:
"/msgapi/getSubTplCls"
,
dataType
:
'json'
,
dataType
:
'json'
,
data
:
{
data
:
{
sel_
msg_tpl_cls
:
sel_msg_tpl
_cls
sel_
edit_cls
:
sel_edit
_cls
},
},
success
:
function
(
result
)
{
success
:
function
(
result
)
{
var
optionstring
=
''
;
var
optionstring
=
''
;
$
.
each
(
result
.
data
,
function
(
i
,
item
){
$
.
each
(
result
.
data
,
function
(
i
,
item
){
optionstring
+=
"<option value="
+
item
.
sub_cls_id
+
">"
+
item
.
sub_cls_
name
+
"</option>"
;
optionstring
+=
"<option value="
+
item
.
cls_id
+
">"
+
item
.
name
+
"</option>"
;
});
});
$
(
"#sel_edit_sub_classify"
).
html
(
'<option value=""></option>'
+
optionstring
);
$
(
"#sel_edit_sub_classify"
).
html
(
'<option value=""></option>'
+
optionstring
);
form
.
render
(
'select'
);
form
.
render
(
'select'
);
...
@@ -49,14 +37,10 @@ layui.use('form', function(){
...
@@ -49,14 +37,10 @@ layui.use('form', function(){
function
showOrHide
(
type
){
function
showOrHide
(
type
){
if
(
'1'
===
type
){
if
(
'1'
===
type
){
$
(
'#add_classify_div'
).
show
();
$
(
'#add_classify_div'
).
show
();
$
(
'#add_sub_classify_div'
).
show
();
$
(
'#edit_classify_div'
).
hide
();
$
(
'#edit_classify_div'
).
hide
();
$
(
'#edit_sub_classify_div'
).
hide
();
}
else
{
}
else
{
$
(
'#add_classify_div'
).
hide
();
$
(
'#add_classify_div'
).
hide
();
$
(
'#add_sub_classify_div'
).
hide
();
$
(
'#edit_classify_div'
).
show
();
$
(
'#edit_classify_div'
).
show
();
$
(
'#edit_sub_classify_div'
).
show
();
}
}
}
}
...
...
public/js/Message/addtemplate.js
View file @
26db6e8a
...
@@ -5,20 +5,20 @@ layui.use(['jquery','element', 'layer', 'form'], function(){
...
@@ -5,20 +5,20 @@ layui.use(['jquery','element', 'layer', 'form'], function(){
var
form
=
layui
.
form
;
var
form
=
layui
.
form
;
//监听模板分类选择 并刷新二级分类数据
//监听模板分类选择 并刷新二级分类数据
form
.
on
(
'select(msg_
tpl_
cls)'
,
function
(
data
){
form
.
on
(
'select(msg_cls)'
,
function
(
data
){
var
sel_
msg_tpl
_cls
=
data
.
value
;
var
sel_
edit
_cls
=
data
.
value
;
$
.
ajax
({
$
.
ajax
({
url
:
"/msgapi/getSubTplCls"
,
url
:
"/msgapi/getSubTplCls"
,
dataType
:
'json'
,
dataType
:
'json'
,
data
:
{
data
:
{
sel_
msg_tpl_cls
:
sel_msg_tpl
_cls
sel_
edit_cls
:
sel_edit
_cls
},
},
success
:
function
(
result
)
{
success
:
function
(
result
)
{
var
optionstring
=
""
;
var
optionstring
=
""
;
$
.
each
(
result
.
data
,
function
(
i
,
item
){
$
.
each
(
result
.
data
,
function
(
i
,
item
){
optionstring
+=
"<option value="
+
item
.
sub_cls_id
+
">"
+
item
.
sub_cls_
name
+
"</option>"
;
optionstring
+=
"<option value="
+
item
.
cls_id
+
">"
+
item
.
name
+
"</option>"
;
});
});
$
(
"#msg_
tpl_
sub_cls"
).
html
(
'<option value=""></option>'
+
optionstring
);
$
(
"#msg_sub_cls"
).
html
(
'<option value=""></option>'
+
optionstring
);
form
.
render
(
'select'
);
form
.
render
(
'select'
);
}
}
});
});
...
@@ -142,8 +142,8 @@ function addTemplate()
...
@@ -142,8 +142,8 @@ function addTemplate()
tpl_id
:
$
(
'#tpl-id'
).
val
(),
tpl_id
:
$
(
'#tpl-id'
).
val
(),
channels
:
getChosenMsgChannels
(),
channels
:
getChosenMsgChannels
(),
msg_type
:
$
(
'#inner-tpl-type option:selected'
).
val
(),
msg_type
:
$
(
'#inner-tpl-type option:selected'
).
val
(),
cls_id
:
$
(
'#msg_tpl
_cls option:selected'
).
val
(),
// cls_id:$('#msg
_cls option:selected').val(),
sub_cls_id
:
$
(
'#msg_
tpl_
sub_cls option:selected'
).
val
(),
sub_cls_id
:
$
(
'#msg_sub_cls option:selected'
).
val
(),
source_type
:
1
,
source_type
:
1
,
creater
:
$
(
'#creater'
).
val
(),
creater
:
$
(
'#creater'
).
val
(),
tpl_key
:
$
(
'#msg-tpl-desc1'
).
val
(),
tpl_key
:
$
(
'#msg-tpl-desc1'
).
val
(),
...
...
public/js/Message/allhistorylist.js
View file @
26db6e8a
...
@@ -53,20 +53,20 @@ layui.use(['laydate','form','table'], function(){
...
@@ -53,20 +53,20 @@ layui.use(['laydate','form','table'], function(){
});
});
//监听模板分类选择 并刷新二级分类数据
//监听模板分类选择 并刷新二级分类数据
form
.
on
(
'select(msg_
tpl_
cls)'
,
function
(
data
){
form
.
on
(
'select(msg_cls)'
,
function
(
data
){
var
sel_
msg_tpl
_cls
=
data
.
value
;
var
sel_
edit
_cls
=
data
.
value
;
$
.
ajax
({
$
.
ajax
({
url
:
"/msgapi/getSubTplCls"
,
url
:
"/msgapi/getSubTplCls"
,
dataType
:
'json'
,
dataType
:
'json'
,
data
:
{
data
:
{
sel_
msg_tpl_cls
:
sel_msg_tpl
_cls
sel_
edit_cls
:
sel_edit
_cls
},
},
success
:
function
(
result
)
{
success
:
function
(
result
)
{
var
optionstring
=
""
;
var
optionstring
=
""
;
$
.
each
(
result
.
data
,
function
(
i
,
item
){
$
.
each
(
result
.
data
,
function
(
i
,
item
){
optionstring
+=
"<option value="
+
item
.
sub_cls_id
+
">"
+
item
.
sub_cls_
name
+
"</option>"
;
optionstring
+=
"<option value="
+
item
.
cls_id
+
">"
+
item
.
name
+
"</option>"
;
});
});
$
(
"#msg_
tpl_
sub_cls"
).
html
(
'<option value=""></option>'
+
optionstring
);
$
(
"#msg_sub_cls"
).
html
(
'<option value=""></option>'
+
optionstring
);
form
.
render
(
'select'
);
form
.
render
(
'select'
);
}
}
});
});
...
...
public/js/Message/templatelist.js
View file @
26db6e8a
...
@@ -6,20 +6,20 @@ layui.use(['jquery','element', 'layer', 'form','table','laypage','laydate'], fun
...
@@ -6,20 +6,20 @@ layui.use(['jquery','element', 'layer', 'form','table','laypage','laydate'], fun
var
table
=
layui
.
table
;
var
table
=
layui
.
table
;
//监听模板分类选择 并刷新二级分类数据
//监听模板分类选择 并刷新二级分类数据
form
.
on
(
'select(msg_
tpl_
cls)'
,
function
(
data
){
form
.
on
(
'select(msg_cls)'
,
function
(
data
){
var
sel_
msg_tpl
_cls
=
data
.
value
;
var
sel_
edit
_cls
=
data
.
value
;
$
.
ajax
({
$
.
ajax
({
url
:
"/msgapi/getSubTplCls"
,
url
:
"/msgapi/getSubTplCls"
,
dataType
:
'json'
,
dataType
:
'json'
,
data
:
{
data
:
{
sel_
msg_tpl_cls
:
sel_msg_tpl
_cls
sel_
edit_cls
:
sel_edit
_cls
},
},
success
:
function
(
result
)
{
success
:
function
(
result
)
{
var
optionstring
=
""
;
var
optionstring
=
""
;
$
.
each
(
result
.
data
,
function
(
i
,
item
){
$
.
each
(
result
.
data
,
function
(
i
,
item
){
optionstring
+=
"<option value="
+
item
.
sub_cls_id
+
">"
+
item
.
sub_cls_
name
+
"</option>"
;
optionstring
+=
"<option value="
+
item
.
cls_id
+
">"
+
item
.
name
+
"</option>"
;
});
});
$
(
"#msg_
tpl_
sub_cls"
).
html
(
'<option value=""></option>'
+
optionstring
);
$
(
"#msg_sub_cls"
).
html
(
'<option value=""></option>'
+
optionstring
);
form
.
render
(
'select'
);
form
.
render
(
'select'
);
}
}
});
});
...
...
resources/views/message/addclassify.blade.php
View file @
26db6e8a
...
@@ -2,9 +2,6 @@
...
@@ -2,9 +2,6 @@
label
{
label
{
box-sizing
:
content-box
;
box-sizing
:
content-box
;
}
}
.number-input
{
width
:
60px
;
}
.top-20
{
.top-20
{
margin-top
:
30px
;
margin-top
:
30px
;
}
}
...
@@ -22,14 +19,6 @@
...
@@ -22,14 +19,6 @@
<div
class=
"layui-form-item top-20"
id=
"add_classify_div"
>
<div
class=
"layui-form-item top-20"
id=
"add_classify_div"
>
<label
class=
"layui-form-label"
>
添加分类:
</label>
<label
class=
"layui-form-label"
>
添加分类:
</label>
<div
class=
"layui-input-inline"
style=
"width: 200px;"
>
<input
type=
"text"
name=
"add_classify"
id=
"add_classify"
placeholder=
"请输入分类名称"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-form-item top-20"
id=
"add_sub_classify_div"
>
<label
class=
"layui-form-label"
>
添加子分类:
</label>
<div
class=
"layui-input-inline"
style=
"width: 150px"
>
<div
class=
"layui-input-inline"
style=
"width: 150px"
>
<select
name=
"sel_add_classify"
lay-filter=
"sel_add_classify"
id=
"sel_add_classify"
>
<select
name=
"sel_add_classify"
lay-filter=
"sel_add_classify"
id=
"sel_add_classify"
>
<option
value=
""
>
请选择一级分类
</option>
<option
value=
""
>
请选择一级分类
</option>
...
@@ -42,36 +31,15 @@
...
@@ -42,36 +31,15 @@
</div>
</div>
<div
class=
"layui-input-inline"
style=
"width: 200px;"
>
<div
class=
"layui-input-inline"
style=
"width: 200px;"
>
<input
type=
"text"
name=
"add_
sub_classify"
id=
"add_sub_classify"
placeholder=
"请输入子
分类名称"
autocomplete=
"off"
class=
"layui-input"
>
<input
type=
"text"
name=
"add_
classify"
id=
"add_classify"
placeholder=
"请输入
分类名称"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item top-20"
id=
"edit_classify_div"
hidden
>
<div
class=
"layui-form-item top-20"
id=
"edit_classify_div"
hidden
>
<label
class=
"layui-form-label"
>
编辑分类:
</label>
<label
class=
"layui-form-label"
>
编辑分类:
</label>
<div
class=
"layui-input-inline"
style=
"width: 150px"
>
<div
class=
"layui-input-inline"
style=
"width: 150px"
>
<select
name=
"sel_edit_classify_1st"
lay-filter=
"sel_edit_classify_1st"
id=
"sel_edit_classify_1st"
>
<select
name=
"sel_edit_classify"
lay-filter=
"sel_edit_classify"
id=
"sel_edit_classify"
>
<option
value=
""
>
请选择一级分类
</option>
@if(!empty($info))
@foreach($info as $k=>$v)
<option
value=
"{{ $k }}"
>
{{ $v }}
</option>
@endforeach
@endif
</select>
</div>
<div
class=
"layui-input-inline"
style=
"width: 200px;"
>
<input
type=
"text"
name=
"edit_classify"
id=
"edit_classify"
placeholder=
"请输入分类名称"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-form-item top-20"
id=
"edit_sub_classify_div"
hidden
>
<label
class=
"layui-form-label"
>
编辑子分类:
</label>
<div
class=
"layui-input-inline"
style=
"width: 150px"
>
<select
name=
"sel_edit_classify_2nd"
lay-filter=
"sel_edit_classify_2nd"
id=
"sel_edit_classify_2nd"
>
<option
value=
""
>
请选择一级分类
</option>
<option
value=
""
>
请选择一级分类
</option>
@if(!empty($info))
@if(!empty($info))
@foreach($info as $k=>$v)
@foreach($info as $k=>$v)
...
@@ -88,7 +56,7 @@
...
@@ -88,7 +56,7 @@
</div>
</div>
<div
class=
"layui-input-inline"
style=
"width: 200px;"
>
<div
class=
"layui-input-inline"
style=
"width: 200px;"
>
<input
type=
"text"
name=
"edit_
sub_classify"
id=
"edit_sub_classify"
placeholder=
"请输入子
分类名称"
autocomplete=
"off"
class=
"layui-input"
>
<input
type=
"text"
name=
"edit_
classify"
id=
"edit_classify"
placeholder=
"请输入
分类名称"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
</div>
</div>
...
...
resources/views/message/addtemplate.blade.php
View file @
26db6e8a
...
@@ -117,10 +117,10 @@
...
@@ -117,10 +117,10 @@
<div
class=
"layui-form-item"
style=
"margin-top: 30px;"
>
<div
class=
"layui-form-item"
style=
"margin-top: 30px;"
>
<label
class=
"layui-form-label title-width"
>
消息模板分类:
</label>
<label
class=
"layui-form-label title-width"
>
消息模板分类:
</label>
<div
class=
"layui-input-inline"
style=
"width: 200px;"
>
<div
class=
"layui-input-inline"
style=
"width: 200px;"
>
<select
name=
"msg_
tpl_cls"
lay-filter=
"msg_tpl_cls"
id=
"msg_tpl
_cls"
>
<select
name=
"msg_
cls"
lay-filter=
"msg_cls"
id=
"msg
_cls"
>
<option
value=
""
selected=
""
>
请选择
</option>
<option
value=
""
selected=
""
>
请选择
</option>
@foreach($msg_tpl_clses as $key=>$value)
@foreach($msg_tpl_clses as $key=>$value)
<option
value=
"{{$key}}"
@
if
(!
empty
($
info-
>
cls_id)
&&
$key==$info->cls
_id) selected @endif>{{$value}}
</option>
<option
value=
"{{$key}}"
@
if
(!
empty
($
info-
>
parent_id)
&&
$key==$info->parent
_id) selected @endif>{{$value}}
</option>
@endforeach
@endforeach
</select>
</select>
</div>
</div>
...
@@ -129,10 +129,10 @@
...
@@ -129,10 +129,10 @@
<div
class=
"layui-form-item"
style=
"margin-top: 30px;"
>
<div
class=
"layui-form-item"
style=
"margin-top: 30px;"
>
<label
class=
"layui-form-label title-width"
>
消息模板二级分类:
</label>
<label
class=
"layui-form-label title-width"
>
消息模板二级分类:
</label>
<div
class=
"layui-input-inline"
style=
"width: 200px;"
>
<div
class=
"layui-input-inline"
style=
"width: 200px;"
>
<select
name=
"msg_
tpl_sub_cls"
lay-filter=
"msg_tpl_sub_cls"
id=
"msg_tpl
_sub_cls"
>
<select
name=
"msg_
sub_cls"
lay-filter=
"msg_sub_cls"
id=
"msg
_sub_cls"
>
<option
value=
""
selected=
""
>
请选择
</option>
<option
value=
""
selected=
""
>
请选择
</option>
@foreach($msg_tpl_sub_clses as $key=>$value)
@foreach($msg_tpl_sub_clses as $key=>$value)
<option
value=
"{{$key}}"
@
if
(!
empty
($
info-
>
sub_cls_id)
&&
$key==$info->sub_
cls_id) selected @endif>{{$value}}
</option>
<option
value=
"{{$key}}"
@
if
(!
empty
($
info-
>
cls_id)
&&
$key==$info->
cls_id) selected @endif>{{$value}}
</option>
@endforeach
@endforeach
</select>
</select>
</div>
</div>
...
...
resources/views/message/allhistorylist.blade.php
View file @
26db6e8a
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
<label
class=
"layui-form-label filter-label-left first-label"
>
消息模板分类:
</label>
<label
class=
"layui-form-label filter-label-left first-label"
>
消息模板分类:
</label>
<div
class=
"layui-input-inline filter-select"
>
<div
class=
"layui-input-inline filter-select"
>
<select
name=
"msg_
tpl_cls"
lay-filter=
"msg_tpl_cls"
id=
"msg_tpl
_cls"
>
<select
name=
"msg_
cls"
lay-filter=
"msg_cls"
id=
"msg
_cls"
>
<option
value=
""
>
请选择
</option>
<option
value=
""
>
请选择
</option>
@foreach($clses as $k=>$v)
@foreach($clses as $k=>$v)
<option
value=
"{{$k}}"
>
{{$v}}
</option>
<option
value=
"{{$k}}"
>
{{$v}}
</option>
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
<label
class=
"layui-form-label filter-label-left first-label"
>
消息模板二级分类:
</label>
<label
class=
"layui-form-label filter-label-left first-label"
>
消息模板二级分类:
</label>
<div
class=
"layui-input-inline filter-select"
>
<div
class=
"layui-input-inline filter-select"
>
<select
name=
"msg_
tpl_sub_cls"
lay-filter=
"msg_tpl_sub_cls"
id=
"msg_tpl
_sub_cls"
>
<select
name=
"msg_
sub_cls"
lay-filter=
"msg_sub_cls"
id=
"msg
_sub_cls"
>
<option
value=
""
>
请选择
</option>
<option
value=
""
>
请选择
</option>
</select>
</select>
</div>
</div>
...
...
resources/views/message/templatelist.blade.php
View file @
26db6e8a
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<label
class=
"layui-form-label filter-label-left"
>
消息模板分类:
</label>
<label
class=
"layui-form-label filter-label-left"
>
消息模板分类:
</label>
<div
class=
"layui-input-inline filter-select"
>
<div
class=
"layui-input-inline filter-select"
>
<select
name=
"msg_
tpl_cls"
lay-filter=
"msg_tpl_cls"
id=
"msg_tpl
_cls"
>
<select
name=
"msg_
cls"
lay-filter=
"msg_cls"
id=
"msg
_cls"
>
<option
value=
""
>
请选择
</option>
<option
value=
""
>
请选择
</option>
@foreach($clses as $k=>$v)
@foreach($clses as $k=>$v)
<option
value=
"{{$k}}"
>
{{$v}}
</option>
<option
value=
"{{$k}}"
>
{{$v}}
</option>
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
<label
class=
"layui-form-label filter-label-left"
>
消息模板二级分类:
</label>
<label
class=
"layui-form-label filter-label-left"
>
消息模板二级分类:
</label>
<div
class=
"layui-input-inline filter-select"
>
<div
class=
"layui-input-inline filter-select"
>
<select
name=
"msg_
tpl_sub_cls"
lay-filter=
"msg_tpl_sub_cls"
id=
"msg_tpl
_sub_cls"
>
<select
name=
"msg_
sub_cls"
lay-filter=
"msg_sub_cls"
id=
"msg
_sub_cls"
>
<option
value=
""
>
请选择
</option>
<option
value=
""
>
请选择
</option>
</select>
</select>
</div>
</div>
...
...
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