Преглед на файлове

fix:首页未读消息数获取

duxin преди 2 години
родител
ревизия
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