diff --git a/worldsrv/lotterymgr.go b/worldsrv/lotterymgr.go index f729219..cc8b20a 100644 --- a/worldsrv/lotterymgr.go +++ b/worldsrv/lotterymgr.go @@ -309,6 +309,15 @@ func (l *LotteryData) Done() { if code != nil && isMust { code.SnId = awardPlayer.SnId } + if code == nil && isMust { + code = &model.LotteryCode{ + Platform: l.Platform, + SnId: awardPlayer.SnId, + CId: l.CId, + StartTs: l.StartTs, + Code: fmt.Sprintf("%d", l.TotalCode), + } + } // 查询玩家消耗 if code != nil && code.SnId > 0 { list, err := model.GetLottery(l.Platform, code.SnId, l.CId, l.StartTs) @@ -342,15 +351,6 @@ func (l *LotteryData) Done() { defer func() { l.isDone = false }() - if code == nil && isMust { - code = &model.LotteryCode{ - Platform: l.Platform, - SnId: awardPlayer.SnId, - CId: l.CId, - StartTs: l.StartTs, - Code: fmt.Sprintf("%d", l.TotalCode), - } - } if code == nil { return }