Commit 3ce0882a by 孙龙

批量发送信息

parent 74252aa5
......@@ -97,7 +97,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['ex_str'] = $data['tpl_key'];
$tpl_model['source_type'] = $data['source_type'];
$tpl_model['creater'] = $data['creater'];
$tpl_model['obj_user'] = $data['obj_user'];
......@@ -546,7 +546,7 @@ class MessageApiController extends Controller
$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,[2,3])) return back()->with("error_batch_msg","暂支持单独发送邮件或短信");
if(!in_array($info->channels,[1,2,3])) return back()->with("error_batch_msg","暂支持单独发送邮件或短信");
if($file){
try{
$excel_file_path = $file->getRealPath();
......@@ -617,7 +617,6 @@ class MessageApiController extends Controller
// exit;
return back()->with("success_batch_msg","上传成功");
}catch(\Exception $e){
// dump($e->getMessage());
$channel->tx_rollback();
return back()->with("error_batch_msg",$e->getMessage());
}
......
......@@ -16,7 +16,7 @@ return [
"rabbitmq"=>[
'host'=>'192.168.1.188',
'host'=>'192.168.2.245',
'port'=>'5672',
'login'=>'guest',
'password'=>'guest',
......
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -121,17 +121,17 @@
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
<div class="wrapper wrapper-content">
<div class="col-lg-11">
<div class="wrapper wrapper-content" >
<div class="col-lg-12" style="background-color: #fff;padding-bottom: 50px">
<div class="ibox float-e-margins">
<form action="/msgapi/updateMsgExcel" method="post" id="postForm" enctype ="multipart/form-data">
{{--外部统一模板描述+消息渠道提示--}}
<div style="margin-left: 40px;" >
<div style="margin: 0 auto;width: 70%" >
<div class="col-sm-10 form-inline layui-form-item" style="margin-top: 20px">
<label class="col-sm-4 control-label layui-form-label" style="width: 100px;font-weight: bold"> *选择模板:</label>
<div class="col-sm-3 layui-input-block" style=" margin-left: 90px;">
<div class="col-sm-3 layui-input-block" style=" margin-left: 2%;">
<select lay-verify="required" class="form-control select2" name="inner-choose-type" id="choose-tpl">
@if(empty($info->tpl_id))
<option value="0" selected>请选择消息模板</option>
......@@ -179,7 +179,7 @@
<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">
<button type="button" name="img_upload" class="layui-btn" id="test1">
<button style="width: 100%" type="button" name="img_upload" class="layui-btn" id="test1">
<i class="layui-icon">&#xe67c;</i>上传文件
</button>
<input style="display: none" type="file" id="file" name="file" >
......@@ -194,19 +194,118 @@
@if($op_type==2)
{{--外部统一提交按钮--}}
<div class="col-sm-10" style="margin-top: 40px">
<div class="col-sm-12" style="width: 70%;margin: 50px auto 0 auto">
<div align="center">
<button class="btn btn-primary" id="submit123">提交发送</button>
<button style="width: 35%" class="layui-btn layui-btn-fluid" id="submit123">提交发送</button>
</div>
</div>
@endif
</div>
</div>
<div class="layui-col-md12" style="margin-top: 50px">
<div class="layui-card">
<div class="layui-card-header">通用模板下载(<span style="color: #ff0000">表头字段禁止修改</span>)</div>
<div class="layui-card-body" style="height: 500px;">
<div class="layui-table-header">
<table cellspacing="0" cellpadding="0" border="0" class="layui-table">
<thead>
<tr>
<th data-field="id">
<div class="layui-table-cell">
<span>模板关键字</span>
</div>
</th>
<th data-field="username">
<div class="layui-table-cell">
<span>消息渠道</span>
</div>
</th>
<th data-field="username">
<div class="layui-table-cell">
<span>模板分类</span>
</div>
</th>
<th data-field="username">
<div class="layui-table-cell">
<span>模板二级分类</span>
</div>
</th>
<th data-field="username">
<div class="layui-table-cell">
<span>下载</span>
</div>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>批量发送站内信</td>
<td>短信</td>
<td>其它</td>
<td>展会活动</td>
<td><a class="layui-btn" href="/export/zhanneixin.xls">下载</a></td>
</tr>
<tr>
<td colspan="4">
<div><span style="color: #ff0000">备注:</span></div>
<div>
列字段:[1:会员账号] [2:京东卡余额] [3:卡号] [4:卡密]
</div>
</td>
</tr>
<tr>
<td>批量发送邮件</td>
<td>邮件</td>
<td>其它</td>
<td>展会活动</td>
<td><a class="layui-btn" href="/export/zh-email.xlsx">下载</a></td>
</tr>
<tr>
<td colspan="4">
<div><span style="color: #ff0000">备注:</span></div>
<div>列字段:[1:用户] [ 2:name] [3:otherinfo] [4:admin] [5:passwd] </div>
</td>
</tr>
<tr>
<td>批量发送短信</td>
<td>短信</td>
<td>其它</td>
<td>展会活动</td>
<td><a class="layui-btn" href="/export/zh-duanxin.xlsx">下载</a></td>
</tr>
<tr>
<td colspan="4">
<div><span style="color: #ff0000">备注:</span></div>
<div>
列字段:[1:用户] [ 2:name] [3:otherinfo]
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
$("#test1").click(function(){
$("input[name='file']").click()
......
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