pull/351/head
wangchuxiao 3 years ago
parent 099461dbbf
commit 5469bb6508

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

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

Loading…
Cancel
Save