Commit 7db0fc68 authored by hujiebin's avatar hujiebin

fix:day

parent 85969f50
......@@ -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
......
......@@ -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
}
// 标记已经处理
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment