From 7db0fc68fbb6d792ed3d5f72b12226c1ab2faeed Mon Sep 17 00:00:00 2001 From: hujiebin Date: Tue, 7 Mar 2023 16:45:05 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9Aday?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/model/groupPower_m/group_grade.go | 6 +++--- domain/service/event_s/send_gift.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/domain/model/groupPower_m/group_grade.go b/domain/model/groupPower_m/group_grade.go index 05e624f..a09f10f 100644 --- a/domain/model/groupPower_m/group_grade.go +++ b/domain/model/groupPower_m/group_grade.go @@ -9,7 +9,7 @@ import ( "time" ) -type GroupPowerExp struct { +type GroupPowerDayExp struct { Date string GroupPowerId mysql.ID Exp int64 @@ -38,12 +38,12 @@ func IncrGroupPowerExp(txModel *domain.Model, groupPowerId mysql.ID, exp int64) }() // 增加家族经验-天 date := time.Now().Format("2006-01-02") - gpe := &GroupPowerExp{ + gpe := &GroupPowerDayExp{ Date: date, GroupPowerId: groupPowerId, Exp: exp, } - if err = txModel.DB().Model(GroupPowerExp{}).Clauses(clause.OnConflict{Columns: []clause.Column{{Name: "date"}, {Name: "group_power_id"}}, + if err = txModel.DB().Model(GroupPowerDayExp{}).Clauses(clause.OnConflict{Columns: []clause.Column{{Name: "date"}, {Name: "group_power_id"}}, DoUpdates: clause.Assignments(map[string]interface{}{ "exp": gorm.Expr("exp + ?", gpe.Exp)})}).Create(gpe).Error; err != nil { return err diff --git a/domain/service/event_s/send_gift.go b/domain/service/event_s/send_gift.go index 159955a..9125763 100644 --- a/domain/service/event_s/send_gift.go +++ b/domain/service/event_s/send_gift.go @@ -57,7 +57,7 @@ func (s *GiftSendEventService) Consume() error { return nil } if err := gift_ev.PublishSendGiftEvent(model, sendGiftEvent); err != nil { - model.Log.Errorf("PublishSendGiftEvent fail,event:%v,err:%v", cpEvent, err) + model.Log.Errorf("PublishSendGiftEvent fail,event:%v,err:%v", string(cpEvent.Payload), err) return err } // 标记已经处理 -- 2.22.0