Commit 90eb7c01 by 李洋

update code

parent 69699848
......@@ -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-->站内信,短信,邮件
......
......@@ -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()
{
......
......@@ -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;"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment