Commit ca8b07dd by 李洋

1、添加手动发送消息时 模板描述唯一性逻辑

parent a3d6785e
...@@ -219,20 +219,26 @@ class MessageApiController extends Controller ...@@ -219,20 +219,26 @@ class MessageApiController extends Controller
//发送手动消息 //发送手动消息
private function sendManualMessage($request) private function sendManualMessage($request)
{ {
// Csrf($request);
$data = $request->input(); $data = $request->input();
$url = 'http://api.liexin.com/msg/sendMessageByHandle'; $is_dumplicated = DB::connection('message')->table('lie_msg_tpl')->where('description',$data['description'])->first();
if($is_dumplicated !== NULL)
{
$this->Export(11024, '已存在相同模板描述,请更换描述内容');
}
// $url = 'http://api.liexin.com/msg/sendMessageByHandle';
// $url = 'http://szapi.ichunt.com/msg/sendMessageByHandle'; // $url = 'http://szapi.ichunt.com/msg/sendMessageByHandle';
// $url = 'http://api.ichunt.com/msg/sendMessageByHandle';
// $url = ''; $url = '';
// $current_domain = $_SERVER['HTTP_HOST']; $current_domain = $_SERVER['HTTP_HOST'];
// if($current_domain === Config('app.api_address')['local']) if($current_domain === "message.liexin.com")
// { {
// $url = 'http://api.liexin.com/msg/sendMessageByHandle'; $url = Config('app.api_address')['local'];
// }elseif ($current_domain === Config('app.api_address')['test']) }elseif ($current_domain === "message.ichunt.net")
// { {
// $url = 'http://szapi.ichunt.com/msg/sendMessageByHandle'; $url = Config('app.api_address')['test'];
// } }
$params = []; $params = [];
$params['channels'] = $data['channels']; $params['channels'] = $data['channels'];
......
...@@ -203,4 +203,9 @@ return [ ...@@ -203,4 +203,9 @@ return [
], ],
'api_address' => [
'local' => 'http://api.liexin.com/msg/sendMessageByHandle',
'test' => 'http://szapi.ichunt.com/msg/sendMessageByHandle',
],
]; ];
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