作者 yangfu

模板修改

@@ -558,10 +558,12 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe @@ -558,10 +558,12 @@ 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 { 561 + if chanceType.Name != request.Name {
  562 + if _, err = models.GetChanceTypeByName(companyId, request.Name); err == nil {
562 err = protocol.NewErrWithMessage("10271") 563 err = protocol.NewErrWithMessage("10271")
563 return 564 return
564 } 565 }
  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())
567 return 569 return