Showing
3 changed files
with
146 additions
and
22 deletions
| @@ -109,14 +109,14 @@ class Sms extends Common | @@ -109,14 +109,14 @@ class Sms extends Common | ||
| 109 | WHERE | 109 | WHERE |
| 110 | $__Where | 110 | $__Where |
| 111 | ORDER BY | 111 | ORDER BY |
| 112 | - n.sid | 112 | + n.id |
| 113 | LIMIT $page,".$data['limit']); | 113 | LIMIT $page,".$data['limit']); |
| 114 | foreach ($list as $key => $value) { | 114 | foreach ($list as $key => $value) { |
| 115 | $list[$key]['channel'] = $value['channel'] == 1 ? "小程序" : "电话机"; | 115 | $list[$key]['channel'] = $value['channel'] == 1 ? "小程序" : "电话机"; |
| 116 | $list[$key]['is_send_end'] = $value['is_send_end'] == 1 ? "是" : "否"; | 116 | $list[$key]['is_send_end'] = $value['is_send_end'] == 1 ? "是" : "否"; |
| 117 | 117 | ||
| 118 | $list[$key]['addtime'] = date("Y-m-d H:i:s",$value['addtime']); | 118 | $list[$key]['addtime'] = date("Y-m-d H:i:s",$value['addtime']); |
| 119 | - $list[$key]['stime'] = date("Y-m-d H:i:s",$value['stime']); | 119 | + $list[$key]['stime'] = $value['stime'] ? date("Y-m-d H:i:s",$value['stime']) : ""; |
| 120 | 120 | ||
| 121 | switch ($value['type_id']) { | 121 | switch ($value['type_id']) { |
| 122 | case '1': | 122 | case '1': |
| @@ -155,4 +155,33 @@ class Sms extends Common | @@ -155,4 +155,33 @@ class Sms extends Common | ||
| 155 | $this->assign ( 'title','营销短信列表'); | 155 | $this->assign ( 'title','营销短信列表'); |
| 156 | return $this->fetch(); | 156 | return $this->fetch(); |
| 157 | } | 157 | } |
| 158 | + | ||
| 159 | + //营销短信审核 | ||
| 160 | + public function smsToExamine(){ | ||
| 161 | + $data = Request::except('file'); | ||
| 162 | + if(Request::isAjax()){ | ||
| 163 | + //通过 | ||
| 164 | + if($data['id'] && $data['dishesVideo']=='pass'){ | ||
| 165 | + $up=Db::query("UPDATE `xt-member-two-LINE`.xt_dc_dz_batch_notice set status = 1,tmp_code='".$data['tem_code']."',remarks='".$data['content']."' where id = ".$data['id']); | ||
| 166 | + } | ||
| 167 | + //未通过 | ||
| 168 | + if($data['id'] && $data['dishesVideo'] == 'notpass'){ | ||
| 169 | + $up=Db::query("UPDATE `xt-member-two-LINE`.xt_dc_dz_batch_notice set status = -1,remarks='".$data['content']."' where id = ".$data['id']); | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + if(!$up){ | ||
| 173 | + $result['code'] = 200; | ||
| 174 | + $result['msg'] = '审核成功'; | ||
| 175 | + $result['url'] =url('Sms/GetBatchNoticeList'); | ||
| 176 | + }else{ | ||
| 177 | + $result['code'] = 0; | ||
| 178 | + $result['msg'] = '审核失败'; | ||
| 179 | + } | ||
| 180 | + return $result; | ||
| 181 | + } | ||
| 182 | + $info = $data['id'] ? $data : array(); //任务ID | ||
| 183 | + $this->assign('info',$info); | ||
| 184 | + $this->assign('title','营销短信审核'); | ||
| 185 | + return $this->fetch(); | ||
| 186 | + } | ||
| 158 | } | 187 | } |
| @@ -28,7 +28,12 @@ | @@ -28,7 +28,12 @@ | ||
| 28 | </div> | 28 | </div> |
| 29 | <table class="layui-table" id="list" lay-filter="list"></table> | 29 | <table class="layui-table" id="list" lay-filter="list"></table> |
| 30 | </div> | 30 | </div> |
| 31 | -<script type="text/html" id="toolbarDemo"> | 31 | +<script type="text/html" id="action"> |
| 32 | + {{# if(d.status == "未通过" || d.status =="已发送"|| d.status =="待发送"){ }} | ||
| 33 | + <button type="button" class="layui-btn layui-btn-xs layui-btn-disabled">已审核</button> | ||
| 34 | + {{# } else { }} | ||
| 35 | + <button type="button" class="layui-btn layui-btn-xs" lay-event="update">审核</button> | ||
| 36 | + {{# } }} | ||
| 32 | </script> | 37 | </script> |
| 33 | {include file="common/foot"/} | 38 | {include file="common/foot"/} |
| 34 | <script> | 39 | <script> |
| @@ -43,26 +48,20 @@ | @@ -43,26 +48,20 @@ | ||
| 43 | page:true, | 48 | page:true, |
| 44 | toolbar: '#toolbarDemo', | 49 | toolbar: '#toolbarDemo', |
| 45 | cols: [[ | 50 | cols: [[ |
| 46 | - {field: 'sid', title: '{:lang("sid")}',width:70, fixed: true}, | ||
| 47 | - {field: 'sellername', align: 'center',title: '店铺名字'}, | ||
| 48 | - {field: 'type_id', title: '来源'}, | ||
| 49 | {field: 'id', title: '营销ID'}, | 51 | {field: 'id', title: '营销ID'}, |
| 50 | - {field: 'tmp_code', title: '模板CODE'}, | ||
| 51 | - {field: 'send_phones', title: '发送号码'}, | ||
| 52 | - {field: 'send_total', align: 'center', title: '发送人数'}, | ||
| 53 | - {field: 'send_msg', align: 'center', title: '发送内容'}, | ||
| 54 | - {field: 'name', align: 'center',title: '负责发送人'}, | ||
| 55 | - {field: 'phone', align: 'center',title: '负责人手机号'}, | ||
| 56 | - {field: 'note_name', align: 'center',title: '创建人'}, | ||
| 57 | - {field: 'sender', align: 'center',title: '发送人'}, | ||
| 58 | - {field: 'reduce_num', align: 'center',title: '短信扣除数'}, | ||
| 59 | - {field: 'status', align: 'center',title: '审核状态'}, | ||
| 60 | - {field: 'channel', align: 'center',title: '发送渠道'}, | ||
| 61 | - {field: 'is_send_end', align: 'center',title: '是否发送完毕'}, | ||
| 62 | - {field: 'channel', align: 'center',title: '发送渠道'}, | ||
| 63 | - {field: 'channel', align: 'center',title: '发送渠道'}, | ||
| 64 | - {field: 'stime', align: 'center',title: '发送时间'}, | ||
| 65 | - {field: 'addtime', align: 'center',title: '创建时间'}, | 52 | + {field: 'sellername',title: '店铺名字'}, |
| 53 | + {field: 'type_id', title: '来源'}, | ||
| 54 | + {field: 'send_total', title: '发送人数'}, | ||
| 55 | + {field: 'send_msg', title: '发送内容'}, | ||
| 56 | + {field: 'phone',title: '负责人手机号'}, | ||
| 57 | + {field: 'note_name',title: '创建人'}, | ||
| 58 | + {field: 'reduce_num',title: '短信扣除数'}, | ||
| 59 | + {field: 'status',title: '短信状态'}, | ||
| 60 | + {field: 'channel',title: '发送渠道'}, | ||
| 61 | + {field: 'is_send_end',width:120,title: '是否发送完毕'}, | ||
| 62 | + {field: 'stime',title: '发送时间'}, | ||
| 63 | + {field: 'addtime',title: '创建时间'}, | ||
| 64 | + {align: 'center', width:200,title: '操作', toolbar: '#action'} | ||
| 66 | ]], | 65 | ]], |
| 67 | done: function(res, curr, count){ | 66 | done: function(res, curr, count){ |
| 68 | 67 | ||
| @@ -110,5 +109,24 @@ | @@ -110,5 +109,24 @@ | ||
| 110 | }); | 109 | }); |
| 111 | } | 110 | } |
| 112 | }; | 111 | }; |
| 112 | + | ||
| 113 | + //监听工具条 | ||
| 114 | + table.on('tool(list)', function(obj){ //注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值" | ||
| 115 | + var data = obj.data; //获得当前行数据 | ||
| 116 | + var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值) | ||
| 117 | + var tr = obj.tr; //获得当前行 tr 的DOM对象 | ||
| 118 | + | ||
| 119 | + if(layEvent === 'update'){ //修改 | ||
| 120 | + //iframe层 | ||
| 121 | + layer.open({ | ||
| 122 | + type: 2, | ||
| 123 | + title: obj.data.sellername, | ||
| 124 | + shadeClose: true, | ||
| 125 | + shade: 0.8, | ||
| 126 | + area: ['50%', '55%'], | ||
| 127 | + content: '{:url("Sms/smsToExamine")}?id='+obj.data.id //iframe的url | ||
| 128 | + }); | ||
| 129 | + } | ||
| 130 | + }); | ||
| 113 | }) | 131 | }) |
| 114 | </script> | 132 | </script> |
| 1 | +{include file="common/head"/} | ||
| 2 | +<div class="admin-main layui-anim layui-anim-upbit" ng-app="hd" ng-controller="ctrl"> | ||
| 3 | + <fieldset class="layui-elem-field layui-field-title"> | ||
| 4 | + <legend>{$title}</legend> | ||
| 5 | + </fieldset> | ||
| 6 | + <form class="layui-form layui-form-pane"> | ||
| 7 | + <input type="hidden" name="id" id="id" value="{if $info.id}{$info.id}{else}请输入商家ID{/if}" autocomplete="on"> | ||
| 8 | + <div class="layui-form-item"> | ||
| 9 | + <label class="layui-form-label">审核状态</label> | ||
| 10 | + <div class="layui-input-block"> | ||
| 11 | + <input type="radio" name="dishesVideo" value="notpass" title="未通过" lay-filter="package"> | ||
| 12 | + <input type="radio" name="dishesVideo" value="pass" title="通过" lay-filter="package"> | ||
| 13 | + </div> | ||
| 14 | + </div> | ||
| 15 | + | ||
| 16 | + <div class="layui-form-item" id='temcode' style='display:none'> | ||
| 17 | + <label class="layui-form-label">模板CODE</label> | ||
| 18 | + <div class="layui-input-6"> | ||
| 19 | + <input type="text" name="tem_code" placeholder="请输入阿里云短信模板CODE 例:SMS_1852316XX" class="layui-input"> | ||
| 20 | + </div> | ||
| 21 | + </div> | ||
| 22 | + | ||
| 23 | + <div class="layui-form-item layui-form-text"> | ||
| 24 | + <label class="layui-form-label">备注</label> | ||
| 25 | + <div class="layui-input-block"> | ||
| 26 | + <textarea placeholder="请输入审核备注,并电话联系商家(未通过原因/通过描述)" name="content" class="layui-textarea"></textarea> | ||
| 27 | + </div> | ||
| 28 | + </div> | ||
| 29 | + <div class="layui-form-item"> | ||
| 30 | + <div class="layui-input-block"> | ||
| 31 | + <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button> | ||
| 32 | + </div> | ||
| 33 | + </div> | ||
| 34 | + </form> | ||
| 35 | +</div> | ||
| 36 | +{include file="common/foot"/} | ||
| 37 | +<script> | ||
| 38 | + layui.use(['form', 'layer','upload'], function () { | ||
| 39 | + var form = layui.form, $ = layui.jquery, upload = layui.upload; | ||
| 40 | + //表单提交 | ||
| 41 | + form.on('submit(submit)', function (data) { | ||
| 42 | + if(!data.field.dishesVideo){ | ||
| 43 | + layer.msg('请选择审核状态!', {time: 1800, icon: 2});return; | ||
| 44 | + } | ||
| 45 | + if(data.field.dishesVideo=='pass'){ | ||
| 46 | + if($.trim(data.field.tem_code)==='' || data.field.tem_code==0){ | ||
| 47 | + layer.msg('请输入正确的短信模板CODE 例: SMS_1852316XX!', {time: 1800, icon: 2});return; | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + if(data.field.content===''){ | ||
| 51 | + layer.msg('请输入审核备注!', {time: 1800, icon: 2});return; | ||
| 52 | + } | ||
| 53 | + // 提交到方法 默认为本身 | ||
| 54 | + layer.confirm('请确认信息是否完整!', function(index){ | ||
| 55 | + var loading = layer.load(1, {shade: [0.1, '#fff']}); | ||
| 56 | + $.post("{:url('smsToExamine')}", data.field, function (res) { | ||
| 57 | + layer.close(loading); | ||
| 58 | + if (res.code > 0) { | ||
| 59 | + layer.msg(res.msg, {time: 1800, icon: 1}, function () { | ||
| 60 | + layer.close(layer.index); | ||
| 61 | + parent.location.reload(); | ||
| 62 | + }); | ||
| 63 | + } else { | ||
| 64 | + layer.msg(res.msg, {time: 1800, icon: 2}); | ||
| 65 | + } | ||
| 66 | + }); | ||
| 67 | + }); | ||
| 68 | + }); | ||
| 69 | + //单选按钮显示隐藏 | ||
| 70 | + form.on('radio(package)', function(data){ | ||
| 71 | + if(data.value == 'pass') | ||
| 72 | + $("#temcode").show(); | ||
| 73 | + else | ||
| 74 | + $("#temcode").hide(); | ||
| 75 | + }); | ||
| 76 | + }); | ||
| 77 | +</script> |
-
Please register or login to post a comment