From 76f3f39a6ce52c5536178468a8c22f24e1256c05 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 8 Aug 2023 19:00:15 +0800 Subject: [PATCH] update --- modules/activity/module.go | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/activity/module.go b/modules/activity/module.go index fa701377d..6c39393f3 100644 --- a/modules/activity/module.go +++ b/modules/activity/module.go @@ -237,11 +237,26 @@ func (this *Activity) HDCelebration(session comm.IUserSession, systemtype int32, update["gotarr"] = data.Gotarr bChange = true } - + if data.Val == 0 { + var pos int32 + _sub := int32((configure.Now().Unix()-activity.Stime)/(24*3600)) + 1 + _days := this.configure.GetHDCelebrationData() + for index, v := range _days { + for i := 0; i < int(v); i++ { + pos++ + if _sub == pos { + data.Val = int32(index) + 1 // 计算val 值 + update["val"] = data.Val + break + } + } + } + data.Val = 1 + } if conf, err := this.configure.GetHDCelebration(data.Val); err == nil { if conf.Systemtype == systemtype { - data.Gotarr[bosstype] += 1 + data.Gotarr[systemtype] += 1 // 天数 var idays int32 for i, v1 := range conf.Bosstype { @@ -253,7 +268,7 @@ func (this *Activity) HDCelebration(session comm.IUserSession, systemtype int32, // 更新信息 update["gotarr"] = data.Gotarr bChange = true - if data.Gotarr[bosstype] <= idays { + if data.Gotarr[systemtype] <= idays { bDouble = true } }