From 4e07455a63b383d38d21a84bfe19f944998a15e0 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 15 Sep 2023 16:35:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/activity/module.go | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/modules/activity/module.go b/modules/activity/module.go index 302a9c1b7..6c3fb78db 100644 --- a/modules/activity/module.go +++ b/modules/activity/module.go @@ -294,9 +294,31 @@ func (this *Activity) GetHdData(session comm.IUserSession, oids []string) (resul continue } } - if activity.Itype == pb.HdType_HdCelebration { + if activity.Itype == pb.HdType_HdCelebration || activity.Itype == pb.HdType_HdLevel || activity.Itype == pb.HdType_HdTypeSign { list, _ = this.modelhdData.getHddataByOid(session.GetUserId(), id) - + if activity.Itype == pb.HdType_HdTypeSign { + if list.Val == 0 || !utils.IsToday(list.Lasttime) { + list.Lasttime = curTime + list.Val += 1 + update := make(map[string]interface{}) + update["lasttime"] = list.Lasttime + update["val"] = list.Val + this.modelhdData.ModifyActivityList(session.GetUserId(), list.Id, update) + } + } + // 开服等级活动 + if activity.Itype == pb.HdType_HdLevel { + if user, err := this.ModuleUser.GetUser(session.GetUserId()); err == nil { + if list.Val != user.Lv { + list.Val = user.Lv + list.Lasttime = curTime + update := make(map[string]interface{}) + update["lasttime"] = list.Lasttime + update["val"] = list.Val + this.modelhdData.ModifyActivityList(session.GetUserId(), list.Id, update) + } + } + } // 获取开服庆典活动 if activity.Itype == pb.HdType_HdCelebration { // key := fmt.Sprintf("%s-%s", session.GetUserId(), id)