mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 09:05:59 +08:00
cms
This commit is contained in:
@@ -77,7 +77,7 @@ func GetFriendByIDCMS(ownerUserID, friendUserID string) (friendUser *FriendUser,
|
||||
err = db.DB.MysqlDB.DefaultGormDB().Table("friends").
|
||||
Select("friends.*, users.name").
|
||||
Where("friends.owner_user_id=? and friends.friend_user_id=?", ownerUserID, friendUserID).
|
||||
Joins("left join friends on friends.friend_user_id = users.user_id").
|
||||
Joins("left join users on friends.friend_user_id = users.user_id").
|
||||
Take(friendUser).Error
|
||||
return friendUser, err
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ func GetChatLog(chatLog db.ChatLog, pageNumber, showNumber int32) ([]db.ChatLog,
|
||||
}
|
||||
|
||||
func GetChatLogCount(chatLog db.ChatLog) (int64, error) {
|
||||
var chatLogs []db.ChatLog
|
||||
var count int64
|
||||
db := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs")
|
||||
if chatLog.Content != "" {
|
||||
@@ -62,6 +61,6 @@ func GetChatLogCount(chatLog db.ChatLog) (int64, error) {
|
||||
db = db.Where("send_time > ? and send_time < ?", chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1))
|
||||
}
|
||||
|
||||
err := db.Find(&chatLogs).Count(&count).Error
|
||||
err := db.Count(&count).Error
|
||||
return count, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user