From 7e80a3d37b8ab94956a2aa8589a3f248ef2083db Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Fri, 25 Oct 2024 17:20:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=9C=AA=E5=BC=80=E5=A5=96?= =?UTF-8?q?=E7=9A=84=E4=B8=AD=E5=A5=96=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/lotterymgr.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/worldsrv/lotterymgr.go b/worldsrv/lotterymgr.go index ea7779c..a0ff340 100644 --- a/worldsrv/lotterymgr.go +++ b/worldsrv/lotterymgr.go @@ -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 {