From 088117d7806aec81ff8f5c207b5e61a6aaa4772a Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 30 Jan 2024 11:58:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86boss=20=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=B8=A6=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/integral/api_challengeover.go | 11 +++++++++++ modules/integral/model_integral.go | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/modules/integral/api_challengeover.go b/modules/integral/api_challengeover.go index 6e4bf8b79..bcc192b50 100644 --- a/modules/integral/api_challengeover.go +++ b/modules/integral/api_challengeover.go @@ -153,6 +153,17 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.IntegralCh Buff: req.Report.Info.Buffer, } update["carrybuff"] = list.Carrybuff + var user *pb.DBUser + if user, err = this.module.GetUserForSession(session); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Message: err.Error(), + } + return + } + list.Uinfo = comm.GetUserBaseInfo(user) + update["uinfo"] = list.Uinfo + // 更新base if err = this.module.modelIntegral.modifyIntegralData(session.GetUserId(), update); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, diff --git a/modules/integral/model_integral.go b/modules/integral/model_integral.go index f52f00dc1..bd99936cf 100644 --- a/modules/integral/model_integral.go +++ b/modules/integral/model_integral.go @@ -56,6 +56,11 @@ func (this *modelIntegral) getIntegralList(session comm.IUserSession) (result *p Carrybuff: map[int32]*pb.FreightBuff{}, } if err = this.Get(uid, result); mgo.MongodbNil == err { + var user *pb.DBUser + user, err = this.module.GetUserForSession(session) + if err != nil { + return + } result.Id = primitive.NewObjectID().Hex() result.Uid = uid result.Buff = make(map[int32]int32) @@ -63,6 +68,7 @@ func (this *modelIntegral) getIntegralList(session comm.IUserSession) (result *p result.Line = make(map[int32]*pb.LineData, 0) result.Achieve = make(map[int32]int32) // 初始化成就 result.Carrybuff = make(map[int32]*pb.FreightBuff) // 初始化成就 + result.Uinfo = comm.GetUserBaseInfo(user) // 获取当前的hid curTime := configure.Now().Unix() szConf := this.module.configure.GetIntegralITime()