Browse Source

调整sql查询条件

fuwencai 3 years ago
parent
commit
57e87666ec
1 changed files with 1 additions and 1 deletions
  1. 1 1
      service/messageService.go

+ 1 - 1
service/messageService.go

@@ -129,7 +129,7 @@ func (service *MessageService) ClassCountAndMessage(userId string, appId string)
 	log.Println("123")
 	defer orm.Close()
 	//m := []*message.Messages{}
-	query, err := orm.QueryInterface("SELECT msg_type,COUNT(CASE WHEN isRead=0 THEN 1 END) as count  FROM message where receive_userid=? and isdel=1 and appid=? and isRead=0 GROUP BY msg_type  ORDER BY FIELD(`msg_type`,\"1\",\"2\",\"3\")", userId, appId)
+	query, err := orm.QueryInterface("SELECT msg_type,COUNT(CASE WHEN isRead=0 THEN 1 END) as count  FROM message where receive_userid=? and isdel=1 and appid=? GROUP BY msg_type  ORDER BY FIELD(`msg_type`,\"1\",\"2\",\"3\")", userId, appId)
 	log.Println(query)
 	if err != nil {
 		return nil, err