From a46e6cd3f2ea5d539fbfb9e1165abddf2f67a655 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 24 May 2023 11:02:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=BC=80=E5=90=AF=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=8F=96=E5=BC=80=E6=9C=8D=E6=97=B6=E9=97=B4=E5=81=9A?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/caravan/model_caravan.go | 10 +++++++--- modules/caravan/module.go | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/caravan/model_caravan.go b/modules/caravan/model_caravan.go index eeb4457c0..f8ba0beb1 100644 --- a/modules/caravan/model_caravan.go +++ b/modules/caravan/model_caravan.go @@ -45,12 +45,16 @@ func (this *modelCaravan) getCaravanList(uid string) (result *pb.DBCaravan, err if err = this.Get(uid, result); err != nil && mgo.MongodbNil == err { // 创建一条数据 result.Id = primitive.NewObjectID().Hex() - - result.Resettime = this.module.service.GetOpentime().Unix() + int64(this.module.ModuleTools.GetGlobalConf().BusinessRewardday*24*3600) + // 活动持续时间 + sTime := int64(this.module.ModuleTools.GetGlobalConf().BusinessRewardday * 24 * 3600) // 单位s + openTime := this.module.service.GetOpentime().Unix() // 获取开服时间 + subTime := configure.Now().Unix() - openTime + result.Resettime = configure.Now().Unix() - (subTime % sTime) + sTime + //result.Resettime = +int64(this.module.ModuleTools.GetGlobalConf().BusinessRewardday * 24 * 3600) result.Citystime = configure.Now().Unix() result.Lv = 1 result.Curcity = this.module.configure.GetCaravanInitCity() // 获取默认城市 - if conf := this.module.configure.GetCaravanLv(1); conf != nil { + if conf := this.module.configure.GetCaravanLv(result.Lv); conf != nil { result.Baglimit = conf.Bagtop } this.module.InitCaravanCityData(uid, result) // 初始1级 diff --git a/modules/caravan/module.go b/modules/caravan/module.go index 2a32ccd41..cbc3334e0 100644 --- a/modules/caravan/module.go +++ b/modules/caravan/module.go @@ -203,8 +203,12 @@ func (this *Caravan) refreshCaravanCityInfo(uid string, caravan *pb.DBCaravan) { } } if configure.Now().Unix() >= caravan.Resettime { - caravan.Resettime = this.service.GetOpentime().Unix() + int64(this.ModuleTools.GetGlobalConf().BusinessRewardday*24*3600) + sTime := int64(this.ModuleTools.GetGlobalConf().BusinessRewardday * 24 * 3600) // 单位s + openTime := this.service.GetOpentime().Unix() // 获取开服时间 + subTime := configure.Now().Unix() - openTime + caravan.Resettime = configure.Now().Unix() - (subTime % sTime) + sTime update["resettime"] = caravan.Resettime + bChange = true } if bChange { update["city"] = caravan.City