Commit 49eba472 authored by hujun's avatar hujun

去除已存在的记录

parent 1dff8307
...@@ -220,7 +220,7 @@ class ChatService ...@@ -220,7 +220,7 @@ class ChatService
//todo 根据设备来判断使用设备用户, //todo 根据设备来判断使用设备用户,
$where['push_id'] = $push_id; $where['push_id'] = $push_id;
$where['type'] = $type; $where['type'] = $type;
$info = $this->chatUserExtModel->getChatUserExtByUserId($where, 'a.id,b.user_id,a.ext_id,a.device_id,a.push_id,a.is_forbidden', 500); $info = $this->chatUserExtModel->getChatUserExtByUserId($where, 'a.id,b.user_id,a.ext_id,a.device_id,a.push_id,a.is_forbidden', 500);
$result = false; $result = false;
if (count($info) > 0) { if (count($info) > 0) {
...@@ -243,6 +243,14 @@ class ChatService ...@@ -243,6 +243,14 @@ class ChatService
$params["push_id"] = $push_id; $params["push_id"] = $push_id;
$params["is_forbidden"] = 0; $params["is_forbidden"] = 0;
$result = $this->chatUserExtModel->addChatUserExt($params); $result = $this->chatUserExtModel->addChatUserExt($params);
} else {
$where2['push_id'] = ['<>', $push_id];
$where2['type'] = $type;
$where2['is_forbidden'] = 0;
$info = $this->chatUserExtModel->getChatUserExtByUserId($where2, 'a.id,b.user_id,a.ext_id,a.device_id,a.push_id,a.is_forbidden', 500);
foreach ($info as $k2=>$v2) {
$this->chatUserExtModel->updateDate(['is_forbidden'=>1], ['id'=>$v2['id']]);
}
} }
} else { } else {
//todo 保存或更新push_id //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