mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
fix:
1.已读未读数排除自己
This commit is contained in:
@@ -33,6 +33,7 @@ public class ContactDao extends ServiceImpl<ContactMapper, Contact> {
|
||||
public Integer getReadCount(Message message) {
|
||||
return lambdaQuery()
|
||||
.eq(Contact::getRoomId, message.getRoomId())
|
||||
.ne(Contact::getUid, message.getFromUid())//不需要查询出自己
|
||||
.ge(Contact::getReadTime, message.getCreateTime())
|
||||
.count();
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ContactServiceImpl implements ContactService {
|
||||
Integer readCount = contactDao.getReadCount(message);
|
||||
readInfoDTO.setReadCount(readCount);
|
||||
if (needUnread) {
|
||||
readInfoDTO.setUnReadCount(finalTotalCount - readCount);
|
||||
readInfoDTO.setUnReadCount(finalTotalCount - readCount - 1);
|
||||
}
|
||||
return readInfoDTO;
|
||||
}).collect(Collectors.toMap(MsgReadInfoDTO::getMsgId, Function.identity()));
|
||||
|
||||
Reference in New Issue
Block a user