二测已质押用户奖励发放
This commit is contained in:
@@ -76,6 +76,21 @@ func (l *StakeSettleLogic) StakeSettle() {
|
|||||||
uid2tokens[s.Uid] += float64(taskConf.LittleTarot)
|
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"))
|
awardSeq := cast.ToInt(time.Now().AddDate(0, 0, -1).Format("20060102"))
|
||||||
for uid, tokens := range uid2tokens {
|
for uid, tokens := range uid2tokens {
|
||||||
coefficient, err := l.svcCtx.StakeRewardModel.GetRandomCoefficientByUid(l.ctx, uid, awardSeq, taskConf.MinCoefficient, taskConf.MaxCoefficient)
|
coefficient, err := l.svcCtx.StakeRewardModel.GetRandomCoefficientByUid(l.ctx, uid, awardSeq, taskConf.MinCoefficient, taskConf.MaxCoefficient)
|
||||||
|
|||||||
Reference in New Issue
Block a user