Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李洋
/
消息系统
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ca8b07dd
authored
Dec 28, 2017
by
李洋
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1、添加手动发送消息时 模板描述唯一性逻辑
parent
a3d6785e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
app/Http/Controllers/MessageApiController.php
config/app.php
app/Http/Controllers/MessageApiController.php
View file @
ca8b07dd
...
...
@@ -219,20 +219,26 @@ class MessageApiController extends Controller
//发送手动消息
private
function
sendManualMessage
(
$request
)
{
// Csrf($request);
$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://api.ichunt.com/msg/sendMessageByHandle';
//
$url = '';
//
$current_domain = $_SERVER['HTTP_HOST'];
// if($current_domain === Config('app.api_address')['local']
)
//
{
// $url = 'http://api.liexin.com/msg/sendMessageByHandle'
;
// }elseif ($current_domain === Config('app.api_address')['test']
)
//
{
// $url = 'http://szapi.ichunt.com/msg/sendMessageByHandle'
;
//
}
$url
=
''
;
$current_domain
=
$_SERVER
[
'HTTP_HOST'
];
if
(
$current_domain
===
"message.liexin.com"
)
{
$url
=
Config
(
'app.api_address'
)[
'local'
]
;
}
elseif
(
$current_domain
===
"message.ichunt.net"
)
{
$url
=
Config
(
'app.api_address'
)[
'test'
]
;
}
$params
=
[];
$params
[
'channels'
]
=
$data
[
'channels'
];
...
...
config/app.php
View file @
ca8b07dd
...
...
@@ -203,4 +203,9 @@ return [
],
'api_address'
=>
[
'local'
=>
'http://api.liexin.com/msg/sendMessageByHandle'
,
'test'
=>
'http://szapi.ichunt.com/msg/sendMessageByHandle'
,
],
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment