隐藏未开奖的中奖信息

This commit is contained in:
sk 2024-10-25 17:20:28 +08:00
parent 721ff30fb8
commit 7e80a3d37b
1 changed files with 13 additions and 2 deletions

View File

@ -167,6 +167,7 @@ func (l *LotteryData) sendAward() {
Name: l.Name,
RoleId: l.RoleId,
Price: l.Price,
WinCode: l.WinCode,
},
}
@ -614,7 +615,7 @@ func (l *LotteryMgr) GetList(plt string) []*welfare.LotteryInfo {
state = common.LotteryStateRun // 进行中
}
ret = append(ret, &welfare.LotteryInfo{
info := &welfare.LotteryInfo{
Id: d.CId,
StartTs: d.StartTs,
EndTs: d.EndTs,
@ -631,7 +632,17 @@ func (l *LotteryMgr) GetList(plt string) []*welfare.LotteryInfo {
Price: d.Price,
NeedRoomCard: LotteryRoomCard,
ImageURL: d.ImageURL,
})
}
if d.WinTs > 0 && d.WinTs > now.Unix() {
// 隐藏未发奖的中奖信息
d.WinCode = ""
d.SnId = 0
d.Name = ""
d.RoleId = 0
}
ret = append(ret, info)
}
sort.Slice(ret, func(i, j int) bool {