| | |
| | | util.ResponseFormat(c, code.RequestParamError, "请选择产品") |
| | | return |
| | | } |
| | | if params.ProductCategoryID == 0 { |
| | | util.ResponseFormat(c, code.RequestParamError, "请选择产品类别") |
| | | return |
| | | } |
| | | //if params.ProductCategoryID == 0 { |
| | | // util.ResponseFormat(c, code.RequestParamError, "请选择产品类别") |
| | | // return |
| | | //} |
| | | |
| | | if err := models.NewLocationProductSearch().Create(¶ms); err != nil { |
| | | logx.Errorf("Operation create err: %v", err) |
| | | util.ResponseFormat(c, code.SaveFail, "添加失败:"+err.Error()) |
| | |
| | | util.ResponseFormat(c, code.RequestParamError, "id为0") |
| | | return |
| | | } |
| | | //TODO:此处可能需要增加限制,如果该上架规则如果已经产生了库存数量,删除会造成库存查不到的影响 |
| | | if err := models.NewLocationProductSearch().SetID(id).Delete(); err != nil { |
| | | logx.Errorf("LocationProduct delete err: %v", err) |
| | | util.ResponseFormat(c, code.SaveFail, "删除失败:"+err.Error()) |