From 37f64eee7b895ce6488c95c1956f6b861c1fcdf3 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 28 Jun 2023 11:49:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=8D=A1=E6=AF=8F=E6=97=A5=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/api_drawCard.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index f587a4375..1adc53391 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -62,16 +62,6 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq return } - // 每日抽卡上限校验 - if cfgGlobal.DrawToplimit < heroRecord.Daycount { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_HeroDrwaMax, - Title: pb.ErrorCode_HeroDrwaMax.ToString(), - Message: fmt.Sprintf("单日抽卡达到上限,抽卡次数:%d", cfgGlobal.DrawToplimit), - } - return - } - for _, v := range drawConf.RecruitmentType { appointmap[v.K] = v.S // 指定次抽数据 } @@ -83,6 +73,17 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq if cfgGlobal == nil { return } + + // 每日抽卡上限校验 + if cfgGlobal.DrawToplimit < heroRecord.Daycount { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_HeroDrwaMax, + Title: pb.ErrorCode_HeroDrwaMax.ToString(), + Message: fmt.Sprintf("单日抽卡达到上限,抽卡次数:%d", cfgGlobal.DrawToplimit), + } + return + } + if errdata = this.DrawCardCheck(session, req); errdata != nil { return }