Просмотр исходного кода

fix:首页未读消息数获取

duxin 2 лет назад
Родитель
Сommit
cd0090abd6
1 измененных файлов с 11 добавлено и 2 удалено
  1. 11 2
      rpc/internal/common/sendMsg.go

+ 11 - 2
rpc/internal/common/sendMsg.go

@@ -227,8 +227,17 @@ func UserMsgList(this *message.UserMsgListReq) *message.UserMsgList {
 		}
 	}
 	data.Count = count
-	if !this.IsColumn && this.Read == 0 {
-		unread = count
+	if !this.IsColumn {
+		if this.Read == 0 {
+			unread = count
+		} else if this.Read == -1 {
+			unread = entity.Mysql.Count("message", map[string]interface{}{
+				"receive_userid": this.UserId,
+				"isdel":          1,
+				"appid":          this.Appid,
+				"isRead":         0,
+			})
+		}
 	}
 	data.Unread = unread
 	return data