| | |
| | | if params.PageInfo.Check() { |
| | | detailsSearch.SetPage(params.Page, params.PageSize) |
| | | } |
| | | details, total, err := detailsSearch.SetPreload(true).SetProductId(params.ProduceId).Find() |
| | | details, total, err := detailsSearch.SetPreload(true).SetOrder("created_at desc").SetProductId(params.ProduceId).Find() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "查询操作详情失败") |
| | | return |
| | |
| | | Description: "", |
| | | InfoInstanceName: "swagger", |
| | | SwaggerTemplate: docTemplate, |
| | | LeftDelim: "{{", |
| | | RightDelim: "}}", |
| | | } |
| | | |
| | | func init() { |
| | |
| | | } |
| | | |
| | | if slf.Keyword != "" { |
| | | db = db.Where("product_name like ?", fmt.Sprintf("%%%v%%", slf.Keyword)) |
| | | db = db.Joins("left join wms_location on wms_location_product_amount.location_id = wms_location.id"). |
| | | Joins("left join material on wms_location_product_amount.product_id = material.id"). |
| | | Joins("left join wms_product_category on wms_location_product_amount.product_category_id = wms_product_category.id"). |
| | | Where("wms_location.name like ?", "%"+slf.Keyword+"%").Or("material.name like ?", "%"+slf.Keyword+"%"). |
| | | Or("wms_product_category.name like ?", "%"+slf.Keyword+"%") |
| | | } |
| | | |
| | | if slf.Preload { |