Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
3140e35e
Commit
3140e35e
authored
Jul 18, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
908f91d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
AppChat.php
application/chat/controller/AppChat.php
+14
-13
ChatService.php
application/chat/service/ChatService.php
+1
-1
No files found.
application/chat/controller/AppChat.php
View file @
3140e35e
...
...
@@ -83,24 +83,25 @@ class AppChat extends Basic
/* $params = array(
"user_id" => 80,
"mobile" => "15821506182",
"source" => 1, //1经纪人 2用户
"is_self" => 0是 1否
"source" => 1, //1经纪人 2用户
"device_id" => "ssss1231231123123",
"push_id" => "ssss1231231123123"
);*/
if
(
!
isset
(
$params
[
'user_id'
])
||
!
isset
(
$params
[
'mobile'
])
||
!
isset
(
$params
[
'source'
])
||
!
isset
(
$params
[
'push_id'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
$user_id
=
$params
[
'user_id'
];
$mobile
=
$params
[
'mobile'
];
$is_self
=
$params
[
'is_self'
];
$source
=
$params
[
'source'
];
$device_id
=
$params
[
'device_id'
];
$push_id
=
$params
[
'push_id'
];
if
(
!
$
user_id
||
!
$mobile
||
!
$source
||
!
$push_id
)
{
if
(
!
$
is_self
||
!
$source
||
!
$user_id
||
!
$mobile
)
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
if
(
$is_self
==
0
&&
(
!
$device_id
||
!
$push_id
))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
$only_arr
=
$this
->
_chat
->
register
(
$user_id
,
$mobile
,
$source
,
$device_id
,
$push_id
);
...
...
@@ -322,11 +323,11 @@ class AppChat extends Basic
public
function
getChatRelation
()
{
$params
=
$this
->
params
;
/* $params = array(
"target" => "agent_5739",
"is_user" => 1,//0用户1经纪人
"relation_list" => '[{"r_id":"13","msg_id":2868},{"r_id":"12","msg_id":2849}]',
);*/
/* $params = array(
"target" => "agent_5739",
"is_user" => 1,//0用户1经纪人
"relation_list" => '[{"r_id":"13","msg_id":2868},{"r_id":"12","msg_id":2849}]',
);*/
if
(
!
isset
(
$params
[
'target'
])
||
!
isset
(
$params
[
"is_user"
]))
{
return
$this
->
response
(
"300"
,
"参数不全"
);
}
...
...
@@ -337,7 +338,7 @@ class AppChat extends Basic
if
(
!
empty
(
$params
[
"relation_list"
]))
{
try
{
$relation_
=
json_decode
(
$params
[
"relation_list"
],
true
);
foreach
(
$relation_
as
$item
){
foreach
(
$relation_
as
$item
)
{
$relation_list
[
$item
[
"r_id"
]][]
=
$item
;
}
}
catch
(
Exception
$exception
)
{
...
...
application/chat/service/ChatService.php
View file @
3140e35e
...
...
@@ -88,7 +88,7 @@ class ChatService
}
//todo 保存或更新push_id
//todo 1.判断设备id +id 的数据是否存在,存在并且push_id和提交的不同则修改,否者新增
if
(
$id
>
0
)
{
if
(
$id
>
0
&&
$device_id
&&
$push_id
)
{
$this
->
savePushId
(
$id
,
$device_id
,
$push_id
);
}
return
[
"code"
=>
200
,
"only_id"
=>
$only_id
];
...
...
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