diff --git a/modules/pagoda/api_getlist.go b/modules/pagoda/api_getlist.go index 790d69471..78ff70456 100644 --- a/modules/pagoda/api_getlist.go +++ b/modules/pagoda/api_getlist.go @@ -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 } diff --git a/modules/pagoda/model_seasonpagoda.go b/modules/pagoda/model_seasonpagoda.go index 9248c99bb..3fe57e7c6 100644 --- a/modules/pagoda/model_seasonpagoda.go +++ b/modules/pagoda/model_seasonpagoda.go @@ -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 }