From 7b0d0d0260f1cc43c506d31649b984185d3509db Mon Sep 17 00:00:00 2001 From: lianghuanjie Date: Wed, 8 Jan 2025 20:32:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E6=B5=8B=E5=B7=B2=E8=B4=A8=E6=8A=BC?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=A5=96=E5=8A=B1=E5=8F=91=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/nft/stake_settle_logic.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/internal/logic/nft/stake_settle_logic.go b/internal/logic/nft/stake_settle_logic.go index a9adf97..d13a232 100644 --- a/internal/logic/nft/stake_settle_logic.go +++ b/internal/logic/nft/stake_settle_logic.go @@ -76,6 +76,21 @@ func (l *StakeSettleLogic) StakeSettle() { uid2tokens[s.Uid] += float64(taskConf.LittleTarot) } } + + // 二测质押未提取的用户 + oldStakeNfts, err := l.svcCtx.OldStakeNftModel.AllStakeNft(l.ctx) + if err != nil { + logx.Errorw("get all stake nft failed", logx.Field("err", err)) + } else { + for _, s := range oldStakeNfts { + if utils.IsBigTarot(cast.ToString(s.TokenId)) { + uid2tokens[s.UserId] += float64(taskConf.GreatTarot) + } else { + uid2tokens[s.UserId] += float64(taskConf.LittleTarot) + } + } + } + awardSeq := cast.ToInt(time.Now().AddDate(0, 0, -1).Format("20060102")) for uid, tokens := range uid2tokens { coefficient, err := l.svcCtx.StakeRewardModel.GetRandomCoefficientByUid(l.ctx, uid, awardSeq, taskConf.MinCoefficient, taskConf.MaxCoefficient)