jiangshuai
2023-11-03 68200e7e7ac1cfd021b8b37a92b7ab8eb11c759e
controllers/location_product.go
@@ -97,7 +97,7 @@
// @Success   200 {object} util.Response   "成功"
// @Router    /api-wms/v1/locationProduct/list [post]
func (slf LocationProductController) List(c *gin.Context) {
   var params request.PageInfo
   var params request.QueryLocationProductConditon
   if err := c.BindJSON(&params); err != nil {
      util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误:"+err.Error())
      return
@@ -109,6 +109,14 @@
   search := models.NewLocationProductSearch()
   search.SetPage(params.Page, params.PageSize)
   if params.ProductId != "" {
      search = search.SetProductId(params.ProductId)
   }
   if params.ProductCategoryId != 0 {
      search = search.SetProductCategoryId(params.ProductCategoryId)
   }
   list, total, err := search.SetPreload(true).SetOrder("created_at desc").FindByPage()
   if err != nil {
      util.ResponseFormat(c, code.RequestError, "查找失败:"+err.Error())