|
@@ -313,6 +313,7 @@ class ChatService implements ChatServiceInterface
|
|
|
$userId = $data['user_id'];
|
|
|
$unreadMessages = ChatRecords::where('user_id', $userId)
|
|
|
->where('is_read', 0)
|
|
|
+ ->where('action', 'recieved')
|
|
|
->leftJoin('user', 'chat_records.receiver_id', '=', 'user.id')
|
|
|
->leftJoin('chat_groups', 'chat_records.receiver_id', '=', 'chat_groups.id')
|
|
|
->select(
|
|
@@ -331,6 +332,7 @@ class ChatService implements ChatServiceInterface
|
|
|
// 查询已读消息,并将 num 字段设置为 0
|
|
|
$readMessages = ChatRecords::where('user_id', $userId)
|
|
|
->where('is_read', 1)
|
|
|
+ ->where('action', 'recieved')
|
|
|
->leftJoin('user', 'chat_records.receiver_id', '=', 'user.id')
|
|
|
->leftJoin('chat_groups', 'chat_records.receiver_id', '=', 'chat_groups.id')
|
|
|
->select(
|