删除排行榜数据接口

This commit is contained in:
meixiongfeng 2022-08-24 17:57:53 +08:00
parent 823b585ede
commit 8aed7bc49b
2 changed files with 21 additions and 1 deletions

View File

@ -45,5 +45,19 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq
list.Type = season.Type
}
// cu, err := this.module.ModuleUser.UserOnlineList()
// if err != nil {
// code = pb.ErrorCode_DBError
// return
// }
// var randOnlineUsers []string
// if len(cu) > 5 {
// randArr := utils.Numbers(0, len(cu), 5)
// for _, v := range randArr {
// if cu[v] != nil {
// randOnlineUsers = append(randOnlineUsers, cu[v].Uid)
// }
// }
// }
return
}

View File

@ -3,10 +3,12 @@ package pagoda
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/lego/sys/redis"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/x/bsonx"
)
@ -57,6 +59,10 @@ func (this *ModelSeasonPagoda) addNewSeasonPagoda(uId string, data *pb.DBSeasonP
// 赛季结束 清理所有塔数据
func (this *ModelSeasonPagoda) DleAllSeasonData() {
this.DB.DeleteMany(core.SqlTable(this.TableName), bson.M{})
err := this.Redis.Ltrim(comm.TablePagodaRank, 0, -1)
if err != nil {
log.Errorf("delete failed")
}
return
}