Commit ec3a2067 by 李洋

1、消息描述加中文

parent bd302620
......@@ -39,7 +39,10 @@ class MessageApiController extends Controller
$this->Export(11001, '请勾选至少一个消息渠道');
}
if (empty($data['description'])) {
$this->Export(11002, '请输入模板描述');
$this->Export(11002, '请输入消息key');
}
if (empty($data['tpl_key'])) {
$this->Export(11003, '请输入模板描述');
}
$is_dumplicated = DB::connection('message')->table('lie_msg_tpl')->where('description',$data['description'])->first();
......@@ -47,14 +50,14 @@ class MessageApiController extends Controller
{
if($is_dumplicated !== NULL)
{
$this->Export(11022, '已存在相同模板描述,请更换描述内容');
$this->Export(11022, '已存在相同模板key,请更换key内容');
}
}else
{
$is_edit_dumplicated = DB::connection('message')->table('lie_msg_tpl')->where('description',$data['description'])->whereNotIn('tpl_id',[$insert_tpl_id])->first();
if($is_edit_dumplicated !== NULL)
{
$this->Export(11023, '已存在相同模板描述,请更换描述内容');
$this->Export(11023, '已存在相同模板key,请更换key内容');
}
}
......@@ -66,6 +69,7 @@ class MessageApiController extends Controller
$tpl_model['tpl_id'] = $data['tpl_id'];
$tpl_model['channels'] = $data['channels'];
$tpl_model['description'] = $data['description'];
$tpl_model['ex_str'] = $data['tpl_key'];
$tpl_model['source_type'] = $data['source_type'];
$tpl_model['creater'] = $data['creater'];
$tpl_model['obj_user'] = $data['obj_user'];
......@@ -285,7 +289,7 @@ class MessageApiController extends Controller
$is_dumplicated = DB::connection('message')->table('lie_msg_tpl')->where('description',$data['description'])->first();
if($is_dumplicated !== NULL)
{
$this->Export(11024, '已存在相同模板描述,请更换描述内容');
$this->Export(11024, '已存在相同模板key,请更换key内容');
}
$url = '';
......@@ -306,6 +310,7 @@ class MessageApiController extends Controller
$params['msg_type'] = $data['msg_type'];
// $params['creater'] = $data['creater'];
$params['description'] = $data['description'];
$params['ex_str'] = $data['tpl_key'];
$params['title_1'] = $data['title_1'];
$params['title_3'] = $data['title_3'];
$params['content_1'] = $data['content_1'];
......
......@@ -199,10 +199,10 @@ class MessageController extends Controller
//渠道里没有0,所以如果没选,将此条件剔除掉
if(0==$search_channel)
{
$info = $cnt->table('lie_msg_tpl')->where('source_type','1')->where('description','like',"%$search_desc%")->orderBy('tpl_id','desc')->paginate(20);
$info = $cnt->table('lie_msg_tpl')->where('source_type','1')->where('ex_str','like',"%$search_desc%")->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_desc%")->orderBy('tpl_id','desc')->paginate(20);
$info = $cnt->table('lie_msg_tpl')->where('source_type','1')->where('channels','like',"%$search_channel%")->where('ex_str','like',"%$search_desc%")->orderBy('tpl_id','desc')->paginate(20);
}
}
......@@ -231,7 +231,8 @@ class MessageController extends Controller
'站内信',
'短信',
'邮件',
'微信通知'
'微信通知',
'钉钉通知'
];
$data=[
'title'=>'asd',
......@@ -293,14 +294,14 @@ class MessageController extends Controller
$info = $db->table('lie_msg_log')->groupBy('lie_msg_log.tpl_id')->having('lie_msg_log.source_type','=',2)
->whereBetween('lie_msg_log.actual_send_time',[$start_time,$end_time])
->join('lie_msg_tpl','lie_msg_log.tpl_id','=','lie_msg_tpl.tpl_id')
->where('lie_msg_tpl.description','like',"%$search_desc%")->orderBy('log_id','desc')->get();
->where('lie_msg_tpl.ex_str','like',"%$search_desc%")->orderBy('log_id','desc')->get();
}else
{
$info = $db->table('lie_msg_log')->groupBy('lie_msg_log.tpl_id')->having('lie_msg_log.source_type','=',2)
->join('lie_msg_tpl','lie_msg_log.tpl_id','=','lie_msg_tpl.tpl_id')
->whereBetween('lie_msg_log.actual_send_time',[$start_time,$end_time])
->where('lie_msg_tpl.channels','like',"%$search_channel%")
->where('lie_msg_tpl.description','like',"%$search_desc%")->orderBy('log_id','desc')->get();
->where('lie_msg_tpl.ex_str','like',"%$search_desc%")->orderBy('log_id','desc')->get();
}
}
......@@ -473,7 +474,7 @@ class MessageController extends Controller
if(!empty($rq_tpl_id))
{
//通过tpl_id找到模板的渠道们 和 描述等
$info = $db->table('lie_msg_tpl')->select('tpl_id','description','channels','msg_type','creater','source_type','obj_user')->where('tpl_id',$rq_tpl_id)->first();
$info = $db->table('lie_msg_tpl')->select('tpl_id','description','channels','msg_type','creater','source_type','obj_user','ex_str')->where('tpl_id',$rq_tpl_id)->first();
//通过找到的 channels 去渠道模板表里 把每个channel找出来
$tpl_channels_arr = explode(',',$info->channels);
......@@ -516,6 +517,7 @@ class MessageController extends Controller
{
$info = (object)null;
$info->tpl_id = '';
$info->ex_str = '';
$info->description = '';
$info->channels ='';
$info->channel_tpls = [];
......@@ -597,8 +599,9 @@ class MessageController extends Controller
}
//通过tpl_id找到模板的渠道们 和 描述
$desc_and_channels = $db->table('lie_msg_tpl')->select('description','channels','msg_type')->where('tpl_id',$info->tpl_id)->first();
$desc_and_channels = $db->table('lie_msg_tpl')->select('description','ex_str','channels','msg_type')->where('tpl_id',$info->tpl_id)->first();
$info->desc = $desc_and_channels->description;
$info->ex_str = $desc_and_channels->ex_str;
$info->channels_str = $this->changeNumberStrToChineseStr(['站内信','短信','邮箱','微信通知'],$desc_and_channels->channels);
$info->channels = $desc_and_channels->channels;
$info->msg_type = $desc_and_channels->msg_type;
......@@ -626,7 +629,7 @@ class MessageController extends Controller
}
//找出所有模板(给选择模板用)
$all_msg_tpl = $db->table('lie_msg_tpl')->select('tpl_id','description')->get();
$all_msg_tpl = $db->table('lie_msg_tpl')->select('tpl_id','ex_str','description')->get();
if(empty($info))
{
......@@ -636,6 +639,7 @@ class MessageController extends Controller
$info->actual_send_time = '';
$info->expect_send_time = '';
$info->desc = '';
$info->ex_str = '';
$info->channels_str = '';
$info->channels ='';
$info->channel_tpls = [];
......
......@@ -12,6 +12,12 @@ $('#msg-tpl-submit').click(function()
return false;
}
if(!$('#msg-tpl-desc1').val())
{
Prompt('请输入消息key', 5);
return false;
}
if(!$('#msg-tpl-desc').val())
{
Prompt('请输入模板描述', 5);
......@@ -110,6 +116,7 @@ function addTemplate()
msg_type:$('#inner-tpl-type option:selected').val(),
source_type:1,
creater:$('#creater').val(),
tpl_key:$('#msg-tpl-desc1').val(),
description:$('#msg-tpl-desc').val(),
obj_user:$('#msg-specified-users-text').val(),
......
......@@ -29,6 +29,11 @@ $('#msg-tpl-submit').click(function()
Prompt('请输入模板描述', 5);
return false;
}
if(!$('#msg-tpl-desc1').val())
{
Prompt('请输入模板key', 5);
return false;
}
//2.渠道模板
//站内信
......@@ -136,7 +141,7 @@ function sendManualMessage()
msg_type:$('#inner-tpl-type option:selected').val()?$('#inner-tpl-type option:selected').val():'',
// creater:$('#creater').val()?$('#creater').val():'',
description:$('#msg-tpl-desc').val()?$('#msg-tpl-desc').val():'',
tpl_key:$('#msg-tpl-desc1').val()?$('#msg-tpl-desc1').val():'',
title_1:$('#inner-tpl-title').val()?$('#inner-tpl-title').val():'',
content_1:ue_inner.getContent()?ue_inner.getContent():'',
op_type:$("input[name='inner-tpl-op']:checked").val()?$("input[name='inner-tpl-op']:checked").val():'',
......
......@@ -122,7 +122,15 @@
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 模板描述:</label>
<div class="col-sm-3">
<input type="text" id="msg-tpl-desc" class="form-control" placeholder="请输入描述" value="{{ $info->description }}"/>
<input type="text" id="msg-tpl-desc1" class="form-control" placeholder="请输入模板描述" value="{{ $info->ex_str }}"/>
<label id="msg-tpl-desc1-length"></label>
</div>
</div>
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 消息key:</label>
<div class="col-sm-3">
<input type="text" id="msg-tpl-desc" class="form-control" placeholder="请输入消息key" value="{{ $info->description }}"/>
<label id="msg-tpl-desc-length"></label>
</div>
</div>
......
......@@ -37,10 +37,10 @@
<form method="get" action="/message/templatelist">
<div style="text-align: center">
<label>消息编号:</label>
<input class="form-control" type="text" id="search-msg-id" placeholder="请输入消息编号" value="{{ $search_id }}"/>
<input class="form-control" type="text" id="search-msg-id" placeholder="请输入消息编号" value="{{ $search_id or '' }}"/>
<label>用户:</label>
<input class="form-control" type="text" id="search-msg-userobj" placeholder="请输入用户" value="{{ $search_user }}">
<input class="form-control" type="text" id="search-msg-userobj" placeholder="请输入用户" value="{{ $search_user or '' }}">
<label>发送时间:</label>
<input type="text" class="form-control" id="Choice_start" name="create_time_start/condition" value="{{ $search_sendtime_start }}"/>-
......@@ -175,6 +175,14 @@
</table>
{!! $info->links() !!}
{{--->appends([--}}
{{--'search_id'=>$search_id,--}}
{{--'search_user'=>$search_user,--}}
{{--'search_sendtime_start'=>$search_sendtime_start,--}}
{{--'search_sendtime_end'=>$search_sendtime_end,--}}
{{--'search_channel'=>$search_channel,--}}
{{--'search_status'=>$search_status,--}}
{{--])->links() !!}--}}
</div>
</div>
<div class="row" id="my_list_paginate"></div>
......
......@@ -117,6 +117,14 @@
</div>
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 模板key:</label>
<div class="col-sm-3">
<input type="text" id="msg-tpl-desc1" class="form-control" placeholder="请输入key" value="{{ $info->ex_str }}"/>
<label id="msg-tpl-desc1-length"></label>
</div>
</div>
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 模板描述:</label>
<div class="col-sm-3">
<input type="text" id="msg-tpl-desc" class="form-control" placeholder="请输入描述" value="{{ $info->desc }}"/>
......@@ -132,7 +140,7 @@
<option value="0" selected>请选择消息模板</option>
@endif
@for($i=0;$i<count($all_msg_tpl);$i++)
<option value="{{ $all_msg_tpl[$i]->tpl_id }}" @if($info->tpl_id==$all_msg_tpl[$i]->tpl_id) selected @endif>{{ $all_msg_tpl[$i]->description }}</option>
<option value="{{ $all_msg_tpl[$i]->tpl_id }}" @if($info->tpl_id==$all_msg_tpl[$i]->tpl_id) selected @endif>{{ $all_msg_tpl[$i]->ex_str }}</option>
@endfor
</select>
</div>
......
......@@ -62,7 +62,7 @@
<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>
......
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