| | |
| | | err error) { |
| | | productAmounts = make([]*models.LocationProductAmount, 0) |
| | | locationSearch := models.NewLocationSearch() |
| | | if params.WarehouseCode != "" { |
| | | locationSearch.SetJointName(params.WarehouseCode) |
| | | //if params.WarehouseCode != "" { |
| | | // locationSearch.SetJointName(params.WarehouseCode) |
| | | //} |
| | | if params.WarehouseId > 0 { |
| | | locationSearch.SetWarehouseId(params.WarehouseId) |
| | | } |
| | | |
| | | locations, err := locationSearch.FindNotTotal() |
| | |
| | | |
| | | //查询产品 |
| | | search = models.NewMaterialSearch() |
| | | search.Orm = search.Orm.Model(&models.Material{}). |
| | | Select(`material.id, material.name, material.cost, material.amount, material.unit, material.more_unit, material.more_unit_value, wms_product_category.name as category_name `). |
| | | Joins("left join wms_product_category on material.category_id = wms_product_category.id") |
| | | search.Orm = search.Orm.Model(&models.Material{}). // material |
| | | Select(`material.id, material.name, material.cost, material.amount, material.unit, material.more_unit, material.more_unit_value, wms_product_category.name as category_name `). |
| | | Joins("left join wms_product_category on material.category_id = wms_product_category.id") |
| | | if len(params.CategoryIds) > 0 { |
| | | search.Orm.Where("material.category_id in (?)", params.CategoryIds) |
| | | } |