常见群聊

This commit is contained in:
2025-12-05 13:55:24 +08:00
parent 5fec786ff0
commit 46abae8148
5 changed files with 87 additions and 98 deletions

View File

@@ -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) {