Commit 253536a8 by 李洋

1、添加重复的 模板描述 错误提示

parent 11845dac
Showing with 6 additions and 0 deletions
......@@ -29,6 +29,7 @@ class MessageApiController extends Controller
private function addTemplate($request)
{
$data = $request->input();
$insert_tpl_id = $data['tpl_id'];
//至少选择一个渠道
......@@ -38,6 +39,11 @@ class MessageApiController extends Controller
if (empty($data['description'])) {
$this->Export(11002, '请输入模板描述');
}
$is_dumplicated = DB::connection('message')->table('lie_msg_tpl')->where('description',$data['description'])->first();
if($is_dumplicated !== false)
{
$this->Export(11022, '已存在相同模板描述,请更换描述内容');
}
//添加事务 保证 数据库多条修改时 原子操作
DB::beginTransaction();
......
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