正在显示
1 个修改的文件
包含
5 行增加
和
3 行删除
@@ -558,9 +558,11 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe | @@ -558,9 +558,11 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe | ||
558 | log.Error("template_id:%v companyId:%v want:%v not equal.", request.Id, companyId, chanceType.CompanyId) | 558 | log.Error("template_id:%v companyId:%v want:%v not equal.", request.Id, companyId, chanceType.CompanyId) |
559 | return | 559 | return |
560 | } | 560 | } |
561 | - if _, err = models.GetChanceTypeByName(companyId, chanceType.Name); err == nil { | ||
562 | - err = protocol.NewErrWithMessage("10271") | ||
563 | - return | 561 | + if chanceType.Name != request.Name { |
562 | + if _, err = models.GetChanceTypeByName(companyId, request.Name); err == nil { | ||
563 | + err = protocol.NewErrWithMessage("10271") | ||
564 | + return | ||
565 | + } | ||
564 | } | 566 | } |
565 | if err = utils.UpdateTableByMap(chanceType, map[string]interface{}{"Name": request.Name, "Icon": request.Icon, "SortNum": chanceType.SortNum, "UpdateAt": time.Now()}); err != nil { | 567 | if err = utils.UpdateTableByMap(chanceType, map[string]interface{}{"Name": request.Name, "Icon": request.Icon, "SortNum": chanceType.SortNum, "UpdateAt": time.Now()}); err != nil { |
566 | log.Error(err.Error()) | 568 | log.Error(err.Error()) |
-
请 注册 或 登录 后发表评论