diff --git a/app/hdl/member_center/hdl_tag_management.go b/app/hdl/member_center/hdl_tag_management.go index 8a024aa..d7984f2 100644 --- a/app/hdl/member_center/hdl_tag_management.go +++ b/app/hdl/member_center/hdl_tag_management.go @@ -107,6 +107,10 @@ func UpdateTag(c *gin.Context) { e.OutErr(c, e.ERR_NO_DATA, errors.New("标签不存在").Error()) return } + tag := &model.UserTag{ + Id: tagID, + } + if oldTag.IsPunish != req.IsPunish { // 标签在被使用情况下不允许修改是否为处罚标签 recordsDb := implement.NewUserTagRecordsDb(db.Db) @@ -119,9 +123,7 @@ func UpdateTag(c *gin.Context) { e.OutErr(c, e.ERR, errors.New("该标签已被使用,无法修改是否为处罚标签").Error()) return } - } - tag := &model.UserTag{ - Id: tagID, + tag.IsPunish = req.IsPunish } if req.Name != "" {