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
d95a5806
Commit
d95a5806
authored
Sep 06, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
当前设备
parent
6ed14e8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
11 deletions
+45
-11
PushMessageService.php
application/api_broker/service/PushMessageService.php
+18
-10
ChatService.php
application/chat/service/ChatService.php
+27
-1
No files found.
application/api_broker/service/PushMessageService.php
View file @
d95a5806
...
@@ -11,6 +11,7 @@ namespace app\api_broker\service;
...
@@ -11,6 +11,7 @@ namespace app\api_broker\service;
use
app\api\service\PushClientService
;
use
app\api\service\PushClientService
;
use
app\api\untils\GeTuiUtils
;
use
app\api\untils\GeTuiUtils
;
use
app\extra\RedisExt
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\ABindingDevice
;
use
app\model\ABindingDevice
;
use
app\model\AStore
;
use
app\model\AStore
;
...
@@ -286,18 +287,24 @@ class PushMessageService
...
@@ -286,18 +287,24 @@ class PushMessageService
return
false
;
return
false
;
}
}
$m_agent_device
=
new
ABindingDevice
();
$key
=
'agent_push_id_'
.
$id
;
$device_id_array
=
$m_agent_device
->
getDeviceByAgentId
([
'agent_id'
=>
$id
,
'is_forbidden'
=>
$is_forbidden
,
'is_pc'
=>
0
],
'id,push_id'
);
$redis
=
RedisExt
::
getRedis
();
$result
=
[];
$push_id
=
$redis
->
get
(
$key
);
if
(
!
empty
(
$device_id_array
))
{
if
(
empty
(
$push_id
))
{
foreach
(
$device_id_array
as
$k
=>
$v
)
{
$m_agent_device
=
new
ABindingDevice
();
if
(
!
empty
(
$v
[
'push_id'
]))
{
$device_id_array
=
$m_agent_device
->
getDeviceByAgentId
([
'agent_id'
=>
$id
,
'is_forbidden'
=>
$is_forbidden
,
'is_pc'
=>
0
],
'id,push_id'
);
$house_id
=
empty
(
$house_id
)
?
''
:
$house_id
;
$result
=
[];
$result
[]
=
$this
->
push
->
public_push_message_for_one
(
$id
,
$v
[
'push_id'
],
$title
,
$content
,
$type
,
$user_id
,
$house_id
,
$order_id
,
$title
);
if
(
!
empty
(
$device_id_array
))
{
foreach
(
$device_id_array
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
'push_id'
]))
{
$house_id
=
empty
(
$house_id
)
?
''
:
$house_id
;
$result
[]
=
$this
->
push
->
public_push_message_for_one
(
$id
,
$v
[
'push_id'
],
$title
,
$content
,
$type
,
$user_id
,
$house_id
,
$order_id
,
$title
);
}
}
}
}
}
}
else
{
$result
[]
=
$this
->
push
->
public_push_message_for_one
(
$id
,
$push_id
,
$title
,
$content
,
$type
,
$user_id
,
$house_id
,
$order_id
,
$title
);
}
}
return
$result
;
return
$result
;
}
}
...
@@ -690,7 +697,7 @@ class PushMessageService
...
@@ -690,7 +697,7 @@ class PushMessageService
}
}
}
}
$this
->
recordCheck
(
9
,
$agent_id_arr
,
$operation_id
,
$record_data
);
$this
->
recordCheck
(
8
,
$agent_id_arr
,
$operation_id
,
$record_data
);
return
true
;
return
true
;
}
}
}
}
\ No newline at end of file
application/chat/service/ChatService.php
View file @
d95a5806
...
@@ -13,6 +13,7 @@ namespace app\chat\service;
...
@@ -13,6 +13,7 @@ namespace app\chat\service;
use
app\api_broker\service\RedisCacheService
;
use
app\api_broker\service\RedisCacheService
;
use
app\chat\utils\RegisterUtil
;
use
app\chat\utils\RegisterUtil
;
use
app\chat\utils\RPush
;
use
app\chat\utils\RPush
;
use
app\extra\RedisExt
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\ChatMsg
;
use
app\model\ChatMsg
;
use
app\model\ChatMsgExt
;
use
app\model\ChatMsgExt
;
...
@@ -89,6 +90,11 @@ class ChatService
...
@@ -89,6 +90,11 @@ class ChatService
if
(
$id
>
0
&&
$device_id
&&
$push_id
)
{
if
(
$id
>
0
&&
$device_id
&&
$push_id
)
{
$this
->
savePushIdV3
(
$id
,
$device_id
,
$push_id
,
$source
);
$this
->
savePushIdV3
(
$id
,
$device_id
,
$push_id
,
$source
);
}
}
if
(
$source
==
1
)
{
$this
->
currentDevice
(
$user_id
,
$push_id
);
//经纪人当前登陆设备
}
return
[
"code"
=>
200
,
"only_id"
=>
$only_id
];
return
[
"code"
=>
200
,
"only_id"
=>
$only_id
];
}
}
...
@@ -714,5 +720,24 @@ class ChatService
...
@@ -714,5 +720,24 @@ class ChatService
return
$this
->
chatUserModel
->
addChatUser
(
$params
);
return
$this
->
chatUserModel
->
addChatUser
(
$params
);
}
}
/**
* 记录当前设备
*
* @param $agent_id
* @param $push_id
* @return bool
*/
public
function
currentDevice
(
$agent_id
,
$push_id
)
{
if
(
empty
(
$agent_id
)
||
empty
(
$push_id
))
{
return
false
;
}
$key
=
'agent_push_id_'
.
$agent_id
;
$redis
=
RedisExt
::
getRedis
();
$push_old
=
$redis
->
get
(
$key
);
if
(
$push_old
!=
$push_id
)
{
$redis
->
set
(
$key
,
$push_id
);
}
return
true
;
}
}
}
\ No newline at end of file
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