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
4dc39d99
Commit
4dc39d99
authored
Nov 18, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微聊串设备推送聊天
parent
6c2fd7dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
Broker.php
application/api_broker/controller/Broker.php
+2
-2
ChatService.php
application/chat/service/ChatService.php
+13
-4
ChatUserExt.php
application/model/ChatUserExt.php
+0
-2
No files found.
application/api_broker/controller/Broker.php
View file @
4dc39d99
...
...
@@ -193,9 +193,9 @@ class Broker extends Basic
/*处理多个手机登录聊天*/
$m_chat_ext
=
new
ChatUserExt
();
$bind_where
[
'is_forbidden'
]
=
0
;
$bind_where
[
'user_id'
]
=
$agents_data
[
'id'
];
$bind_where
[
'user_id'
]
=
[
'<>'
,
$agents_data
[
'id'
]
];
$bind_where
[
'type'
]
=
1
;
$bind_where
[
'push_id'
]
=
[
'<>'
,
$params
[
"push_id"
]
];
$bind_where
[
'push_id'
]
=
$params
[
"push_id"
];
$del_bind_id
=
$m_chat_ext
->
getChatUserExtByUserId
(
$bind_where
,
'a.id'
,
100
);
if
(
count
(
$del_bind_id
)
>
0
)
{
foreach
(
$del_bind_id
as
$v
)
{
...
...
application/chat/service/ChatService.php
View file @
4dc39d99
...
...
@@ -105,14 +105,23 @@ class ChatService
$where
[
'ext_id'
]
=
$chat_user_id
;
$where
[
'device_id'
]
=
$device_id
;
$where
[
'push_id'
]
=
$push_id
;
$where
[
'is_forbidden'
]
=
0
;
$info
=
$this
->
chatUserExtModel
->
getChatUserExt
(
$where
,
'id,ext_id,device_id,push_id'
);
//
$where['is_forbidden'] = 0;
$info
=
$this
->
chatUserExtModel
->
getChatUserExt
(
$where
,
'id,ext_id,device_id,push_id
,is_forbidden
'
);
$result
=
false
;
if
(
count
(
$info
)
>
0
)
{
$update_data
=
[];
if
(
$info
[
0
][
"push_id"
]
!=
$push_id
)
{
//update
$result
=
$this
->
chatUserExtModel
->
addChatUserExt
([
'push_id'
=>
$push_id
],
$info
[
0
][
'id'
]);
$update_data
[
'push_id'
]
=
$push_id
;
}
if
(
$info
[
0
][
'is_forbidden'
]
==
1
)
{
$update_data
[
'is_forbidden'
]
=
0
;
}
if
(
count
(
$update_data
)
>
0
)
{
$result
=
$this
->
chatUserExtModel
->
addChatUserExt
(
$update_data
,
$info
[
0
][
'id'
]);
}
}
else
{
//todo 保存或更新push_id
...
...
@@ -228,7 +237,7 @@ class ChatService
$user_type
=
$item
[
"type"
];
}
}
$where
[
'is_forbidden'
]
=
0
;
$info
=
$userExt
->
getChatUserExtByUserId
(
$where
,
'a.id,a.ext_id,a.device_id,a.push_id,b.user_id'
);
if
(
count
(
$info
)
<=
0
)
{
...
...
application/model/ChatUserExt.php
View file @
4dc39d99
...
...
@@ -34,8 +34,6 @@ class ChatUserExt extends BaseModel
$where_
=
[];
if
(
isset
(
$params
[
'is_forbidden'
]))
{
$where_
[
'is_forbidden'
]
=
$params
[
'is_forbidden'
];
}
else
{
$where_
[
'is_forbidden'
]
=
0
;
}
if
(
isset
(
$params
[
'ext_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