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
79f8cc6e
Commit
79f8cc6e
authored
Nov 16, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
反复登录聊天推送优化
parent
52300faa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
6 deletions
+37
-6
Broker.php
application/api_broker/controller/Broker.php
+7
-6
ChatUserExt.php
application/model/ChatUserExt.php
+30
-0
No files found.
application/api_broker/controller/Broker.php
View file @
79f8cc6e
...
@@ -23,6 +23,7 @@ use app\model\AAgents;
...
@@ -23,6 +23,7 @@ use app\model\AAgents;
use
app\model\ABindingDevice
;
use
app\model\ABindingDevice
;
use
app\model\ACollectUser
;
use
app\model\ACollectUser
;
use
app\model\ASite
;
use
app\model\ASite
;
use
app\model\ChatUserExt
;
use
app\model\Evaluate
;
use
app\model\Evaluate
;
use
app\model\GOperatingRecords
;
use
app\model\GOperatingRecords
;
use
app\model\NoteLog
;
use
app\model\NoteLog
;
...
@@ -189,18 +190,18 @@ class Broker extends Basic
...
@@ -189,18 +190,18 @@ class Broker extends Basic
$redis_
->
set
(
"agent_city_"
.
$agents_data
[
'id'
],
$site_city
[
0
][
'city'
]);
$redis_
->
set
(
"agent_city_"
.
$agents_data
[
'id'
],
$site_city
[
0
][
'city'
]);
$redis_
->
set
(
"agent_site_id_"
.
$agents_data
[
'id'
],
$agents_data
[
'site_id'
]);
$redis_
->
set
(
"agent_site_id_"
.
$agents_data
[
'id'
],
$agents_data
[
'site_id'
]);
/*处理多个手机登录*/
/*处理多个手机登录
聊天
*/
$m_
bind
=
new
ABindingDevice
();
$m_
chat_ext
=
new
ChatUserExt
();
$bind_where
[
'push_id'
]
=
$params
[
"push_id"
];
$bind_where
[
'push_id'
]
=
$params
[
"push_id"
];
$bind_where
[
'device_id'
]
=
$params
[
"device_id"
];
$bind_where
[
'device_id'
]
=
$params
[
"device_id"
];
$bind_where
[
'
agent
_id'
]
=
[
'<>'
,
$agents_data
[
'id'
]];
$bind_where
[
'
user
_id'
]
=
[
'<>'
,
$agents_data
[
'id'
]];
$del_bind_id
=
$m_
bind
->
getDeviceByAgentId
(
$bind_where
,
'id'
);
$del_bind_id
=
$m_
chat_ext
->
getChatUserExtByUserId
(
$bind_where
,
'a.id'
,
100
);
if
(
count
(
$del_bind_id
)
>
0
)
{
if
(
count
(
$del_bind_id
)
>
0
)
{
foreach
(
$del_bind_id
as
$v
)
{
foreach
(
$del_bind_id
as
$v
)
{
$m_
bind
->
updateDevice
([
'id'
=>
$v
[
'id'
],
'is_forbidden'
=>
1
]);
$m_
chat_ext
->
updateDate
([
'is_forbidden'
=>
1
],
[
'id'
=>
$v
[
'id'
]
]);
}
}
}
}
/*处理多个手机登录*/
/*处理多个手机登录
聊天
*/
return
$this
->
response
(
200
,
$data
[
'msg'
],
$data
[
'data'
]);
return
$this
->
response
(
200
,
$data
[
'msg'
],
$data
[
'data'
]);
}
}
...
...
application/model/ChatUserExt.php
View file @
79f8cc6e
...
@@ -75,6 +75,18 @@ class ChatUserExt extends BaseModel
...
@@ -75,6 +75,18 @@ class ChatUserExt extends BaseModel
$where_
[
'b.type'
]
=
$params
[
'type'
];
$where_
[
'b.type'
]
=
$params
[
'type'
];
}
}
if
(
isset
(
$params
[
'user_id'
]))
{
$where_
[
'b.user_id'
]
=
$params
[
'user_id'
];
}
if
(
isset
(
$params
[
'push_id'
]))
{
$where_
[
'a.push_id'
]
=
$params
[
'push_id'
];
}
if
(
isset
(
$params
[
'device_id'
]))
{
$where_
[
'a.device_id'
]
=
$params
[
'device_id'
];
}
$data
=
$this
->
db
->
field
(
$field
)
$data
=
$this
->
db
->
field
(
$field
)
->
alias
(
"a"
)
->
alias
(
"a"
)
->
join
(
"chat_user b"
,
"a.ext_id = b.id"
,
"right"
)
->
join
(
"chat_user b"
,
"a.ext_id = b.id"
,
"right"
)
...
@@ -146,4 +158,21 @@ class ChatUserExt extends BaseModel
...
@@ -146,4 +158,21 @@ class ChatUserExt extends BaseModel
return
$array
;
return
$array
;
}
}
/**
* 编辑
*
* @param array $params
* @param $where
* @return int
* @throws \Exception
*/
public
function
updateDate
(
array
$params
,
$where
)
:
int
{
try
{
$num
=
$this
->
db
->
where
(
$where
)
->
update
(
$params
);
}
catch
(
\Exception
$exception
)
{
$num
=
0
;
}
return
$num
;
}
}
}
\ 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