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
bb922e45
authored
Dec 08, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
02e220b7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
20 deletions
app/Http/Controllers/MessageApiController.php
public/js/Message/jquery.form.js
resources/views/message/sendmanualmessage.blade.php
app/Http/Controllers/MessageApiController.php
View file @
bb922e45
...
...
@@ -542,11 +542,11 @@ class MessageApiController extends Controller
public
function
updateMsgExcel
(
Request
$request
){
$file
=
$request
->
file
(
'file'
);
$tp_id
=
$request
->
get
(
'inner-choose-type'
);
if
(
!
$tp_id
)
return
back
()
->
with
(
"error_batch_msg"
,
"请选择对应消息模板"
);
if
(
!
$tp_id
)
return
$this
->
Export
(
-
1
,
"请选择对应消息模板"
);
$info
=
DB
::
connection
(
"message"
)
->
table
(
"lie_msg_tpl"
)
->
where
(
"tpl_id"
,
intval
(
$tp_id
))
->
select
(
"tpl_id"
,
"channels"
,
"description"
)
->
first
();
if
(
!
$info
)
return
back
()
->
with
(
"error_batch_msg"
,
"没找到对应消息模板"
);
if
(
count
(
explode
(
","
,
$info
->
channels
))
>
1
)
return
back
()
->
with
(
"error_batch_msg"
,
"暂只支持一种渠道消息,请完善模板消息后再来"
);
if
(
!
in_array
(
$info
->
channels
,[
1
,
2
,
3
]))
return
back
()
->
with
(
"error_batch_msg"
,
"暂支持单独发送邮件或短信"
);
if
(
!
$info
)
return
$this
->
Export
(
-
1
,
"没找到对应消息模板"
);
if
(
count
(
explode
(
","
,
$info
->
channels
))
>
1
)
return
$this
->
Export
(
-
1
,
"暂只支持一种渠道消息,请完善模板消息后再来"
);
if
(
!
in_array
(
$info
->
channels
,[
1
,
2
,
3
]))
return
$this
->
Export
(
-
1
,
"暂支持单独发送邮件或短信"
);
if
(
$file
){
try
{
$excel_file_path
=
$file
->
getRealPath
();
...
...
@@ -615,13 +615,13 @@ class MessageApiController extends Controller
$channel
->
close
();
$connection
->
close
();
// exit;
return
back
()
->
with
(
"success_batch_msg"
,
"上传成功"
);
return
$this
->
Export
(
0
,
"上传成功"
);
}
catch
(
\Exception
$e
){
$channel
->
tx_rollback
();
return
back
()
->
with
(
"error_batch_msg"
,
$e
->
getMessage
());
return
$this
->
Export
(
-
1
,
$e
->
getMessage
());
}
}
return
back
()
->
with
(
"error_batch_msg"
,
"请务必上传文件"
);
return
$this
->
Export
(
-
1
,
'请务必上传文件'
);
}
}
\ No newline at end of file
public/js/Message/jquery.form.js
0 → 100644
View file @
bb922e45
This diff is collapsed.
Click to expand it.
resources/views/message/sendmanualmessage.blade.php
View file @
bb922e45
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"/js/Message/editor/ueditor.config.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"/js/Message/editor/ueditor.all.min.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"/js/Message/editor/lang/zh-cn/zh-cn.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"/js/Message/jquery.form.js"
></script>
<style
type=
"text/css"
>
.demo
{
background
:
#ffded7
;
padding
:
2em
0
;}
...
...
@@ -98,21 +99,11 @@
}
</style>
@if(session("error_batch_msg"))
<div
class=
"form-group"
>
<div
class=
"alert alert-danger"
>
{{session("error_batch_msg")}}
</div>
</div>
@endif
@if(session("success_batch_msg"))
@if(session("error_batch_msg"))
<div
class=
"form-group"
>
<div
class=
"alert alert-success"
>
{{session("
success
_batch_msg")}}
{{session("
error
_batch_msg")}}
</div>
</div>
@endif
...
...
@@ -342,7 +333,16 @@
layer
.
msg
(
'请选择对应消息模板'
);
return
false
;
}
$
(
"#postForm"
).
submit
();
// $("#postForm").submit();
$
(
"#postForm"
).
ajaxSubmit
({
url
:
"/msgapi/updateMsgExcel"
,
type
:
"post"
,
enctype
:
'multipart/form-data'
,
success
:
function
(
data
)
{
alert
(
data
.
errmsg
)
}
});
layer
.
msg
(
'提交中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
// 阻止重复提交
// var index = layer.load(0, {shade: false});
});
...
...
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