From 796e14c79c94809afd12909ccbde23851442030d Mon Sep 17 00:00:00 2001 From: hujiebin Date: Thu, 16 Mar 2023 13:52:00 +0800 Subject: [PATCH] fix --- domain/model/groupPower_m/group_star.go | 1 + domain/model/mic_m/mic.go | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/domain/model/groupPower_m/group_star.go b/domain/model/groupPower_m/group_star.go index c58c8fd..a42a9bb 100644 --- a/domain/model/groupPower_m/group_star.go +++ b/domain/model/groupPower_m/group_star.go @@ -30,6 +30,7 @@ func IncrGroupPowerMonthStarScore(model *domain.Model, groupPowerId, userId mysq UserId: userId, Type: _type, Score: score, + LastCalTs: lastCalTs, } if err := model.DB().Model(GroupPowerMonthStar{}).Clauses(clause.OnConflict{ Columns: []clause.Column{{Name: "month"}, {Name: "group_power_id"}, {Name: "user_id"}, {Name: "type"}}, diff --git a/domain/model/mic_m/mic.go b/domain/model/mic_m/mic.go index 8f6d143..64b44ef 100644 --- a/domain/model/mic_m/mic.go +++ b/domain/model/mic_m/mic.go @@ -51,12 +51,13 @@ func IncrUserOnMic(model *domain.Model, userId mysql.ID, joinMicTimestamp int64) score := nowTs - curTs day := time.Now().Format("2006-01-02") onMicNew := &UserOnMic{ - Date: day, - UserId: userId, - Seconds: mysql.Num(score), + Date: day, + UserId: userId, + Seconds: mysql.Num(score), + LastCalTs: nowTs, } if err := model.DB().Model(UserOnMic{}).Clauses(clause.OnConflict{ - Columns: []clause.Column{{Name: "day"}, {Name: "user_id"}}, + Columns: []clause.Column{{Name: "date"}, {Name: "user_id"}}, DoUpdates: clause.Assignments(map[string]interface{}{ "seconds": gorm.Expr("seconds + ?", onMicNew.Seconds), "last_cal_ts": nowTs, -- 2.22.0