Commit 0c5eb387 authored by hujun's avatar hujun

保留一个有效状态

parent 677d3c66
......@@ -161,6 +161,8 @@ class ChatService
if ($v['is_forbidden'] == 0) {
if ($v['ext_id'] != $chat_user_id) {
$this->chatUserExtModel->addChatUserExt(['is_forbidden'=>1], $v['id']);
} else {
$current_user_id = $chat_user_id;
}
} else {
if ($v['ext_id'] == $chat_user_id && $current_user_id != $chat_user_id) {
......@@ -177,6 +179,15 @@ class ChatService
$params["push_id"] = $push_id;
$params["is_forbidden"] = 0;
$result = $this->chatUserExtModel->addChatUserExt($params);
} else {
$old_device_where['ext_id'] = $current_user_id;
$old_device_where['is_forbidden'] = 0;
$old_device_where['push_id'] = ['<>', $push_id];
$info = $this->chatUserExtModel->getChatUserExt($where, 'id');
foreach ($info as $k2=>$v2) {
$this->chatUserExtModel->addChatUserExt(['is_forbidden'=> 1], $v2['id']);
}
}
} else {
//todo 保存或更新push_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment