常见群聊
This commit is contained in:
@@ -149,8 +149,8 @@ class MessageController extends ApiController
|
||||
return $this->error('请传入有效会话ID');
|
||||
}
|
||||
$msgIds = explode(',', $msgIds);
|
||||
$query = Db::name('chat_message')->whereIn('session_id', $msgIds)->where('to_id', $this->uid)
|
||||
->where('is_read', 0);
|
||||
// $query = Db::name('chat_message')->whereIn('session_id', $msgIds)->where('to_id', $this->uid)
|
||||
// ->where('is_read', 0);
|
||||
try {
|
||||
Db::startTrans();
|
||||
// 更新未读计数
|
||||
@@ -158,7 +158,7 @@ class MessageController extends ApiController
|
||||
Db::name('chat_unread_count')->where(['user_id' => $this->uid, 'session_id' => $sessionId])->update(['count' => 0, 'updated_time' => d()]);
|
||||
}
|
||||
// 批量更新
|
||||
$query->update(['is_read' => 1]);
|
||||
// $query->update(['is_read' => 1]);
|
||||
Db::commit();
|
||||
return $this->success(true);
|
||||
}catch (\Throwable $exception) {
|
||||
|
||||
Reference in New Issue
Block a user