This commit is contained in:
cdle 2021-08-21 09:41:15 +08:00
parent fcf9023402
commit 1b5eedba84

View File

@ -61,7 +61,6 @@ func NewActiveUser(class string, uid int, msgs ...interface{}) {
}
}
if first {
db.Model(User{}).Select("count(id) as total").Where("active_at > ?", zero).Pluck("total", &total)
coin := 1
if total[0]%3 == 0 {
@ -74,7 +73,7 @@ func NewActiveUser(class string, uid int, msgs ...interface{}) {
"active_at": ntime,
"coin": gorm.Expr(fmt.Sprintf("coin+%d", coin)),
})
u.Coin++
u.Coin += coin
msg += fmt.Sprintf("你是打卡第%d人奖励%d个许愿币许愿币余额%d。", total[0]+1, coin, u.Coin)
sendMessagee(msg, msgs...)
}