From 8aed7bc49b7c3a0a90fd072c7e0801a2a8a59893 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 24 Aug 2022 17:57:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8E=92=E8=A1=8C=E6=A6=9C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/pagoda/api_getlist.go | 14 ++++++++++++++ modules/pagoda/model_seasonpagoda.go | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) 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 }