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
90eb7c01
authored
Dec 05, 2017
by
李洋
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update code
parent
69699848
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
app/Http/Controllers/MessageController.php
public/js/Message/SendManualMessage.js
resources/views/message/ManualHistoryList.blade.php
app/Http/Controllers/MessageController.php
View file @
90eb7c01
...
...
@@ -288,17 +288,30 @@ class MessageController extends Controller
private
function
sendManualMessage
(
Request
$request
,
$id
,
$viewid
)
{
Csrf
(
$request
);
$map
=
$request
->
input
(
'log_id'
);
$rq_log_id
=
$request
->
input
(
'log_id'
);
//发送人工消息改变了模板的选择时会传过来tpl_id
$rq_tpl_id
=
$request
->
input
(
'tpl_id'
);
$db
=
DB
::
connection
(
'message'
);
$isContainInner
=
''
;
$isContainSMS
=
''
;
$isContainEmail
=
''
;
$isContainWechatNotify
=
''
;
if
(
!
empty
(
$map
))
//编辑时传过来log_id 选择模板时传过来tpl_id
if
(
!
empty
(
$rq_log_id
)
||
!
empty
(
$rq_tpl_id
))
{
$log_id
=
$map
;
$info
=
$db
->
table
(
'lie_msg_log'
)
->
select
(
'tpl_id'
,
'obj_user'
,
'expect_send_time'
)
->
where
(
'log_id'
,
$log_id
)
->
first
();
//1.编辑
if
(
!
empty
(
$rq_log_id
))
{
$log_id
=
$rq_log_id
;
$info
=
$db
->
table
(
'lie_msg_log'
)
->
select
(
'tpl_id'
,
'obj_user'
,
'expect_send_time'
)
->
where
(
'log_id'
,
$log_id
)
->
first
();
}
else
//2.选择模板
{
$info
=
(
object
)
null
;
$info
->
tpl_id
=
$rq_tpl_id
;
$info
->
obj_user
=
''
;
$info
->
expect_send_time
=
0
;
}
//通过tpl_id找到模板的渠道们 和 描述
$desc_and_channels
=
$db
->
table
(
'lie_msg_tpl'
)
->
select
(
'description'
,
'channels'
,
'msg_type'
)
->
where
(
'tpl_id'
,
$info
->
tpl_id
)
->
first
();
...
...
@@ -350,7 +363,6 @@ class MessageController extends Controller
'其他'
];
$data
=
[
'title'
=>
'asd'
,
'id'
=>
$id
,
...
...
@@ -368,7 +380,6 @@ class MessageController extends Controller
//--------------------------------------------inner methods-----------------------------------------
//数字字符串转为对应中文字符串 eg:1,2,3-->站内信,短信,邮件
...
...
public/js/Message/SendManualMessage.js
View file @
90eb7c01
...
...
@@ -161,6 +161,16 @@ $('#sms-tpl-content').bind('input propertychange', function() {
$
(
'#sms-content-length'
).
html
(
'预计'
+
Math
.
ceil
(
$
(
this
).
val
().
length
/
70
)
+
'条短信'
);
});
//选择了模板要刷新整页,并带入请求的值
$
(
'#choose-tpl'
).
change
(
function
()
{
var
tpl_id
=
$
(
'#choose-tpl option:selected'
)
.
val
();
//只要不是0(0是请选择...),就带入tpl_id并跳转刷新
if
(
0
!=
tpl_id
)
{
window
.
location
.
href
=
"/message/sendManualMessage?tpl_id="
+
tpl_id
;
}
})
//获取点选了的消息渠道复选框
function
getChosenMsgChannels
()
{
...
...
resources/views/message/ManualHistoryList.blade.php
View file @
90eb7c01
...
...
@@ -6,7 +6,7 @@
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<div
class=
"form-inline"
>
<a
class=
"btn btn-primary btn-sm"
href=
"/message/sendManualMessage"
>
添加
消息
</a>
<a
class=
"btn btn-primary btn-sm"
href=
"/message/sendManualMessage"
>
发送
消息
</a>
<form
method=
"get"
action=
"/message/templateList"
>
<input
class=
"btn btn-primary btn-sm"
type=
"submit"
value=
"搜索"
style=
"float: right"
/>
<input
type=
"text"
id=
"searchkey"
name=
"message_title"
placeholder=
"请输入消息标题"
style=
"float:right; width: 150px; height: 30px; margin-right: 5px;"
/>
...
...
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