From 1b5eedba84e3c76075c2978ee15cbe6c0014d98a Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Sat, 21 Aug 2021 09:41:15 +0800 Subject: [PATCH] x --- models/user.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/models/user.go b/models/user.go index fc64b08..9691b2b 100644 --- a/models/user.go +++ b/models/user.go @@ -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...) }