liujiandao
2023-11-16 9cc7854c7262346a75b852afc65484be27c9537f
出入库明细添加排序
3个文件已修改
10 ■■■■ 已修改文件
controllers/report_forms_controller.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/location_product_amount.go 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/report_forms_controller.go
@@ -166,7 +166,7 @@
    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
docs/docs.go
@@ -4639,6 +4639,8 @@
    Description:      "",
    InfoInstanceName: "swagger",
    SwaggerTemplate:  docTemplate,
    LeftDelim:        "{{",
    RightDelim:       "}}",
}
func init() {
models/location_product_amount.go
@@ -124,7 +124,11 @@
    }
    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 {