mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-10 03:56:00 +08:00
cms dev
This commit is contained in:
@@ -147,7 +147,7 @@ func GetGroupsCountNum(group db.Group) (int32, error) {
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func GetGroupsById(groupId string) (db.Group, error) {
|
||||
func GetGroupById(groupId string) (db.Group, error) {
|
||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||
group := db.Group{
|
||||
GroupID: groupId,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package im_mysql_model
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/db"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func GetChatLog(chatLog db.ChatLog, pageNumber, showNumber int32) ([]db.ChatLog, error) {
|
||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||
var chatLogs []db.ChatLog
|
||||
if err != nil {
|
||||
return chatLogs, err
|
||||
}
|
||||
dbConn.LogMode(true)
|
||||
err = dbConn.Table("chat_logs").Where(fmt.Sprintf(" content like '%%%s%%' ", chatLog.Content)).Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&chatLogs).Error
|
||||
return chatLogs, err
|
||||
}
|
||||
Reference in New Issue
Block a user