活动bug

This commit is contained in:
meixiongfeng 2023-08-08 18:40:18 +08:00
parent eb5ed69bb6
commit 8a310420c5
2 changed files with 4 additions and 3 deletions

View File

@ -63,7 +63,7 @@ func (this *apiComp) GetHdData(session comm.IUserSession, req *pb.ActivityGetHdD
update := make(map[string]interface{})
// 计算进度
update["lasttime"] = list.Lasttime
update["val"] = list.Val
update["gotarr"] = list.Gotarr
_days := this.module.configure.GetHDCelebrationData()
@ -74,6 +74,7 @@ func (this *apiComp) GetHdData(session comm.IUserSession, req *pb.ActivityGetHdD
pos++
if _sub == pos {
list.Val = int32(index) + 1 // 计算val 值
update["val"] = list.Val
break
}
}

View File

@ -225,7 +225,7 @@ func (this *Activity) HDCelebration(session comm.IUserSession, systemtype int32,
bChange := false
// 查询玩家活动记录
//key := fmt.Sprintf("%s-%s", session.GetUserId(), v.Id)
if data, err := this.modelhdData.getHddataByOid(session.GetUserId(), activity.Id); err != nil {
if data, err := this.modelhdData.getHddataByOid(session.GetUserId(), activity.Id); err == nil {
// 注意 Gotarr:map[int32]int32 key value 已经挑战的次数
if !utils.IsToday(data.Lasttime) { // 不是今天重置
data.Lasttime = configure.Now().Unix()
@ -238,7 +238,7 @@ func (this *Activity) HDCelebration(session comm.IUserSession, systemtype int32,
bChange = true
}
if conf, err := this.configure.GetHDCelebration(data.Val); err != nil {
if conf, err := this.configure.GetHDCelebration(data.Val); err == nil {
if conf.Systemtype == systemtype {
data.Gotarr[bosstype] += 1