nft质押道具发放

This commit is contained in:
lianghuanjie
2025-01-02 15:45:53 +08:00
parent ea86ab71e8
commit bc0aeec1da
9 changed files with 215 additions and 13 deletions

View File

@@ -26,8 +26,9 @@ type (
}
)
// SetReward 对未发送奖励的用户发送奖励,支持并发,且不会重发
func (m *customNhTaskNftStakeRewardModel) SetReward(ctx context.Context, uid uint, awardSeq, occupyPercent int, pledgeOutput, reward decimal.Decimal) error {
update := fmt.Sprintf("UPDATE %s SET `occupy_percent` = ?, `pledge_output` = ?, `reward` = ? WHERE `uid` = ? AND `award_seq` = ?", m.table)
update := fmt.Sprintf("UPDATE %s SET `occupy_percent` = ?, `pledge_output` = ?, `reward` = ?, `sent` = 1 WHERE `uid` = ? AND `award_seq` = ?, `sent` = 0", m.table)
result, err := m.conn.ExecCtx(ctx, update, occupyPercent, pledgeOutput, reward, uid, awardSeq)
if err != nil {
return err