mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
tag
This commit is contained in:
parent
c39f5a27b2
commit
228cbb4082
@ -556,7 +556,7 @@ func (d *DataBases) GetTagSendLogs(userID string, showNumber, pageNumber int32)
|
||||
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
||||
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSendLog)
|
||||
findOpts := options.Find().SetSort(-1).SetLimit(int64(showNumber)).SetSkip(int64(showNumber) * (int64(pageNumber) - 1))
|
||||
cursor, err := c.Find(ctx, bson.D{{"sendID", userID}}, findOpts)
|
||||
cursor, err := c.Find(ctx, bson.M{"sendID": userID}, findOpts)
|
||||
if err != nil {
|
||||
return tagSendLogs, err
|
||||
}
|
||||
|
@ -79,12 +79,12 @@ func GetUserNameByUserID(userID string) (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
var userName string
|
||||
err = dbConn.Table("users").Select("name").Where("user_id=?", userID).First(&userName).Error
|
||||
var user db.User
|
||||
err = dbConn.Table("users").Select("name").Where("user_id=?", userID).First(&user).Error
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return userName, nil
|
||||
return user.Nickname, nil
|
||||
}
|
||||
|
||||
func UpdateUserInfo(user db.User) error {
|
||||
|
Loading…
x
Reference in New Issue
Block a user