diff --git a/_const/enum/cp_e/level.go b/_const/enum/cp_e/level.go index 3cbda5a20efea63c647507a360558317c4d66875..c43f14c2671b0691ee8608456c0bc59d87ea2611 100644 --- a/_const/enum/cp_e/level.go +++ b/_const/enum/cp_e/level.go @@ -3,7 +3,8 @@ package cp_e import "git.hilo.cn/hilo-common/resource/mysql" const ( - EffectDays = 30 // 30天有效期 + EffectDays = 30 // 30天有效期 + CpHeadwearId = 2571 ) type CpLevel int diff --git a/domain/model/cp_m/level.go b/domain/model/cp_m/level.go index dabd445e2bfae13b392ea4bd956f59a4e2189a30..ea6c5a69108c84ff00ba49ffc711c75f66c880b7 100644 --- a/domain/model/cp_m/level.go +++ b/domain/model/cp_m/level.go @@ -277,10 +277,10 @@ func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.N } // 赠送cp头像头饰 if oldLevel < 3 && cpLevel.Level >= 3 { - if err := headwear_tx.SendHeadwear(model, cpRelation.UserId1, 2571, 30); err != nil { + if err := headwear_tx.SendHeadwear(model, cpRelation.UserId1, cp_e.CpHeadwearId, 30); err != nil { return err } - if err := headwear_tx.SendHeadwear(model, cpRelation.UserId2, 2571, 30); err != nil { + if err := headwear_tx.SendHeadwear(model, cpRelation.UserId2, cp_e.CpHeadwearId, 30); err != nil { return err } } diff --git a/route/cp_r/cp_relation.go b/route/cp_r/cp_relation.go index ac7243e4d8bae884c19b4dd72a8826ee1f47fa76..b274afb1453ba896afbadf1c7f3293f813606069 100644 --- a/route/cp_r/cp_relation.go +++ b/route/cp_r/cp_relation.go @@ -376,6 +376,9 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) { Msg: content, Status: 2, }) + // 删除cp头饰 + _ = headwear_tx.DelHeadwear(model, myUser.ID, cp_e.CpHeadwearId) + _ = headwear_tx.DelHeadwear(model, user2.ID, cp_e.CpHeadwearId) } if err := tencentyun.BatchSendCustomMsg(model, 1, myUser.ExternalId, []string{user2.ExternalId}, string(msgData), "cp解除"); err != nil { model.Log.Errorf("ReplyCpCancel BatchSendCustomMsg fail:%v", err)