This commit is contained in:
wangchuxiao
2022-08-30 01:38:23 +08:00
parent da9918b655
commit 8d4e5ad3f1
23 changed files with 548 additions and 2351 deletions
@@ -1,6 +1,7 @@
package im_mysql_model
import (
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
@@ -15,8 +16,10 @@ func GetChatLog(chatLog db.ChatLog, pageNumber, showNumber int32) ([]db.ChatLog,
if chatLog.SessionType != 0 {
db = db.Where("session_type = ?", chatLog.SessionType)
}
if chatLog.ContentType != 0 {
if chatLog.ContentType == 1 {
db = db.Where("content_type = ?", chatLog.ContentType)
} else if chatLog.ContentType == 2 {
db = db.Where("content_type in (?)", []int{constant.GroupChatType, constant.SuperGroupChatType})
}
if chatLog.SendID != "" {
db = db.Where("send_id = ?", chatLog.SendID)