diff --git a/domain/model/groupPower_m/group_grade.go b/domain/model/groupPower_m/group_grade.go index d495a99a1fa542103c773984f4ba03fb53964159..600eb46295869ed55186c82eabd85bde9998c447 100644 --- a/domain/model/groupPower_m/group_grade.go +++ b/domain/model/groupPower_m/group_grade.go @@ -182,7 +182,14 @@ func IncrGroupPowerExpOnMic(model *domain.Model, groupPowerId, userId mysql.ID, // 更新micExp信息 onMic.Seconds = onMic.Seconds + onMicSeconds onMic.LastCalTs = joinMicTimestamp - if err := model.DB().Save(onMic).Error; err != nil { + if err := model.DB().Model(GroupPowerOnMic{}).Clauses(clause.OnConflict{Columns: []clause.Column{{Name: "date"}, {Name: "group_power_id"}}, + DoUpdates: clause.Assignments( + map[string]interface{}{ + "seconds": onMic.Seconds, + "last_cal_ts": joinMicTimestamp, + }, + )}). + Create(onMic).Error; err != nil { return err } }