This commit is contained in:
by 2024-10-16 14:02:26 +08:00
parent b08113a339
commit e672cb58be
1 changed files with 5 additions and 1 deletions

View File

@ -52,7 +52,11 @@ func InsertAnnouncerLog(logs ...*model.AnnouncerLog) (err error) {
// 取最新100条数据
func FetchAnnouncerLog(plt string) (recs []model.AnnouncerLog, err error) {
query := bson.M{}
err = AnnouncerLogCollection(plt).Find(query).Sort("-_id").Limit(100).All(&recs)
c := AnnouncerLogCollection(plt)
if c == nil {
return recs, AnnouncerLogDBErr
}
err = c.Find(query).Sort("-_id").Limit(100).All(&recs)
return
}