This commit is contained in:
wangchuxiao 2022-09-06 17:46:55 +08:00
parent 099461dbbf
commit 5469bb6508
2 changed files with 6 additions and 5 deletions

View File

@ -47,14 +47,14 @@ func GetChatLogCount(chatLog db.ChatLog) (int64, error) {
if chatLog.Content != "" {
db = db.Where(" content like ? ", fmt.Sprintf("%%%s%%", chatLog.Content))
}
if chatLog.SessionType != 0 {
if chatLog.SessionType == 1 {
db = db.Where("session_type = ?", chatLog.SessionType)
}
if chatLog.ContentType == 1 {
db = db.Where("content_type = ?", chatLog.ContentType)
} else if chatLog.ContentType == 2 {
} else if chatLog.SessionType == 2 {
db = db.Where("content_type in (?)", []int{constant.GroupChatType, constant.SuperGroupChatType})
}
if chatLog.ContentType != 0 {
db = db.Where("content_type = ?", chatLog.ContentType)
}
if chatLog.SendID != "" {
db = db.Where("send_id = ?", chatLog.SendID)
}

View File

@ -97,6 +97,7 @@ func GetActiveUsers(from, to time.Time, limit int) ([]*activeUser, error) {
continue
}
activeUser.Name = user.Nickname
activeUser.ID = user.UserID
}
return activeUsers, err
}