|
|
@ -558,7 +558,7 @@ func (d *DataBases) GetTagSendLogs(userID string, showNumber, pageNumber int32)
|
|
|
|
var tagSendLogs []TagSendLog
|
|
|
|
var tagSendLogs []TagSendLog
|
|
|
|
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
|
|
|
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
|
|
|
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSendLog)
|
|
|
|
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSendLog)
|
|
|
|
findOpts := options.Find().SetLimit(int64(showNumber)).SetSkip(int64(showNumber) * (int64(pageNumber) - 1)).SetSort(bson.D{{"send_time", -1}})
|
|
|
|
findOpts := options.Find().SetLimit(int64(showNumber)).SetSkip(int64(showNumber) * (int64(pageNumber) - 1)).SetSort(bson.M{"send_time": -1})
|
|
|
|
cursor, err := c.Find(ctx, bson.M{"send_id": userID}, findOpts)
|
|
|
|
cursor, err := c.Find(ctx, bson.M{"send_id": userID}, findOpts)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return tagSendLogs, err
|
|
|
|
return tagSendLogs, err
|
|
|
|