fix: 质押占领矿洞占比
This commit is contained in:
@@ -101,7 +101,12 @@ func (l *StakeSettleLogic) StakeSettle() {
|
||||
}
|
||||
tokensDecimal := decimal.NewFromFloat(tokens)
|
||||
reward := tokensDecimal.Mul(decimal.NewFromFloat(coefficient))
|
||||
err = l.svcCtx.StakeRewardModel.SetReward(l.ctx, uid, awardSeq, taskConf.OccupyPercent, tokensDecimal, reward)
|
||||
var gameBonus int
|
||||
if l.svcCtx.GamePitModel.UserExist(l.ctx, uid) {
|
||||
gameBonus = taskConf.OccupyPercent
|
||||
reward = reward.Mul(decimal.NewFromFloat(float64(100+gameBonus) / 100))
|
||||
}
|
||||
err = l.svcCtx.StakeRewardModel.SetReward(l.ctx, uid, awardSeq, gameBonus, tokensDecimal, reward)
|
||||
if err != nil {
|
||||
logx.Errorw("set reward failed", logx.Field("err", err), logx.Field("uid", uid), logx.Field("awardSeq", awardSeq), logx.Field("coefficient", coefficient), logx.Field("tokens", tokens), logx.Field("reward", reward))
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user