Commit b151a00e by 李洋

1、删除不勾选的模板渠道

parent d44c7c60
Showing with 36 additions and 0 deletions
...@@ -130,6 +130,15 @@ class MessageApiController extends Controller ...@@ -130,6 +130,15 @@ class MessageApiController extends Controller
$this->Export(11009, '编辑消息模板失败'); $this->Export(11009, '编辑消息模板失败');
} }
} }
}else{
if(!empty($data['inner_channel_tpl_id']))
{
$delete_result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id',$data['inner_channel_tpl_id'])->delete();
if(!$delete_result)
{
$this->Export(11009, '编辑消息模板失败');
}
}
} }
if (strpos($data['channels'], '2') !== false) { if (strpos($data['channels'], '2') !== false) {
if (empty($data['sms_content'])) { if (empty($data['sms_content'])) {
...@@ -155,6 +164,15 @@ class MessageApiController extends Controller ...@@ -155,6 +164,15 @@ class MessageApiController extends Controller
$this->Export(11012, '编辑消息模板失败'); $this->Export(11012, '编辑消息模板失败');
} }
} }
}else{
if(!empty($data['sms_channel_tpl_id']))
{
$delete_result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id',$data['sms_channel_tpl_id'])->delete();
if(!$delete_result)
{
$this->Export(11012, '编辑消息模板失败');
}
}
} }
if (strpos($data['channels'], '3') !== false) { if (strpos($data['channels'], '3') !== false) {
if (empty($data['email_title'])) { if (empty($data['email_title'])) {
...@@ -183,6 +201,15 @@ class MessageApiController extends Controller ...@@ -183,6 +201,15 @@ class MessageApiController extends Controller
$this->Export(11016, '编辑消息模板失败', $result); $this->Export(11016, '编辑消息模板失败', $result);
} }
} }
}else{
if(!empty($data['email_channel_tpl_id']))
{
$delete_result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id',$data['email_channel_tpl_id'])->delete();
if(!$delete_result)
{
$this->Export(11016, '编辑消息模板失败');
}
}
} }
if (strpos($data['channels'], '4') !== false) { if (strpos($data['channels'], '4') !== false) {
if (empty($data['wechat_notify_title'])) { if (empty($data['wechat_notify_title'])) {
...@@ -212,6 +239,15 @@ class MessageApiController extends Controller ...@@ -212,6 +239,15 @@ class MessageApiController extends Controller
$this->Export(11019, '编辑消息模板失败'); $this->Export(11019, '编辑消息模板失败');
} }
} }
}else{
if(!empty($data['wechat_notify_tpl_id']))
{
$delete_result = DB::connection('message')->table('lie_msg_channel_tpl')->where('channel_tpl_id',$data['wechat_notify_tpl_id'])->delete();
if(!$delete_result)
{
$this->Export(11019, '编辑消息模板失败');
}
}
} }
DB::commit(); DB::commit();
}catch (\Exception $e){ }catch (\Exception $e){
......
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