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
e9771a85
authored
Dec 27, 2017
by
李洋
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix bug
parent
588c8a89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
app/Http/Controllers/MessageApiController.php
app/Http/Controllers/MessageApiController.php
View file @
e9771a85
...
@@ -12,6 +12,7 @@ use Illuminate\Http\Request;
...
@@ -12,6 +12,7 @@ use Illuminate\Http\Request;
use
App\Http\Requests
;
use
App\Http\Requests
;
use
DB
;
use
DB
;
use
RedisDB
;
use
RedisDB
;
use
Config
;
class
MessageApiController
extends
Controller
class
MessageApiController
extends
Controller
{
{
...
@@ -39,12 +40,24 @@ class MessageApiController extends Controller
...
@@ -39,12 +40,24 @@ class MessageApiController extends Controller
if
(
empty
(
$data
[
'description'
]))
{
if
(
empty
(
$data
[
'description'
]))
{
$this
->
Export
(
11002
,
'请输入模板描述'
);
$this
->
Export
(
11002
,
'请输入模板描述'
);
}
}
$is_dumplicated
=
DB
::
connection
(
'message'
)
->
table
(
'lie_msg_tpl'
)
->
where
(
'description'
,
$data
[
'description'
])
->
first
();
$is_dumplicated
=
DB
::
connection
(
'message'
)
->
table
(
'lie_msg_tpl'
)
->
where
(
'description'
,
$data
[
'description'
])
->
first
();
if
(
$is_dumplicated
!==
false
&&
empty
(
$insert_tpl_id
))
if
(
empty
(
$insert_tpl_id
))
{
if
(
$is_dumplicated
!==
NULL
)
{
$this
->
Export
(
11022
,
'已存在相同模板描述,请更换描述内容'
);
}
}
else
{
{
$this
->
Export
(
11022
,
'已存在相同模板描述,请更换描述内容'
);
$is_edit_dumplicated
=
DB
::
connection
(
'message'
)
->
table
(
'lie_msg_tpl'
)
->
where
(
'description'
,
$data
[
'description'
])
->
whereNotIn
(
'tpl_id'
,[
$insert_tpl_id
])
->
first
();
if
(
$is_edit_dumplicated
!==
NULL
)
{
$this
->
Export
(
11023
,
'已存在相同模板描述,请更换描述内容'
);
}
}
}
//添加事务 保证 数据库多条修改时 原子操作
//添加事务 保证 数据库多条修改时 原子操作
DB
::
beginTransaction
();
DB
::
beginTransaction
();
try
{
try
{
...
@@ -211,6 +224,16 @@ class MessageApiController extends Controller
...
@@ -211,6 +224,16 @@ class MessageApiController extends Controller
$url
=
'http://api.liexin.com/msg/sendMessageByHandle'
;
$url
=
'http://api.liexin.com/msg/sendMessageByHandle'
;
// $url = 'http://szapi.ichunt.com/msg/sendMessageByHandle';
// $url = 'http://szapi.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';
// }
$params
=
[];
$params
=
[];
$params
[
'channels'
]
=
$data
[
'channels'
];
$params
[
'channels'
]
=
$data
[
'channels'
];
$params
[
'msg_type'
]
=
$data
[
'msg_type'
];
$params
[
'msg_type'
]
=
$data
[
'msg_type'
];
...
...
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