|
|
|
|
@ -667,8 +667,10 @@ func ShareRankHandler() { |
|
|
|
|
} |
|
|
|
|
timer := time.NewTimer(nextSettleAt.Sub(now)) |
|
|
|
|
<-timer.C |
|
|
|
|
|
|
|
|
|
shareRankAward() |
|
|
|
|
nextSettleAt = util.GetWeekZeroTime(now).AddDate(0, 0, 7).Add(30 * time.Minute) |
|
|
|
|
log.Debug("next share rank at: %s", nextSettleAt.Format(time.DateTime)) |
|
|
|
|
timer.Reset(nextSettleAt.Sub(time.Now())) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
@ -900,6 +902,10 @@ func UpdateShare(uid, updateType int, updateValue int64, expand ...string) (err |
|
|
|
|
RewardAt: now.Unix(), |
|
|
|
|
} |
|
|
|
|
awardCount = updateValue |
|
|
|
|
if awardCount == 0 { // 绑定的时候不关心奖励数
|
|
|
|
|
awardCount = amount |
|
|
|
|
updateValue = amount |
|
|
|
|
} |
|
|
|
|
updateValues["reward"] = gorm.Expr("reward + ?", amount) |
|
|
|
|
updateValues["withdrawable"] = gorm.Expr("withdrawable + ?", amount) |
|
|
|
|
} |
|
|
|
|
|