作者 yangfu

模板修改

... ... @@ -558,9 +558,11 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe
log.Error("template_id:%v companyId:%v want:%v not equal.", request.Id, companyId, chanceType.CompanyId)
return
}
if _, err = models.GetChanceTypeByName(companyId, chanceType.Name); err == nil {
err = protocol.NewErrWithMessage("10271")
return
if chanceType.Name != request.Name {
if _, err = models.GetChanceTypeByName(companyId, request.Name); err == nil {
err = protocol.NewErrWithMessage("10271")
return
}
}
if err = utils.UpdateTableByMap(chanceType, map[string]interface{}{"Name": request.Name, "Icon": request.Icon, "SortNum": chanceType.SortNum, "UpdateAt": time.Now()}); err != nil {
log.Error(err.Error())
... ...