| | |
| | | return |
| | | } |
| | | |
| | | first, err := models.NewProductCategorySearch().SetID(cast.ToUint(id)).First() |
| | | first, err := models.NewProductCategorySearch().SetID(cast.ToInt(id)).First() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "查找失败") |
| | | return |
| | |
| | | util.ResponseFormat(c, code.RequestParamError, "产品类型名称不能为空") |
| | | return |
| | | } |
| | | err := models.NewProductCategorySearch().SetID(params.ID).Save(¶ms) |
| | | err := models.NewProductCategorySearch().SetID(params.Id).Save(¶ms) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "产品类型信息更新失败") |
| | | return |
| | |
| | | util.ResponseFormat(c, code.RequestParamError, "无效id") |
| | | return |
| | | } |
| | | err := models.NewProductCategorySearch().SetID(cast.ToUint(id)).Delete() |
| | | err := models.NewProductCategorySearch().SetID(cast.ToInt(id)).Delete() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "删除失败") |
| | | return |