yinbentan
2024-07-11 e042d530a290bb0e45e59fe5c06d813618d0e546
service/inventory_report_forms.go
@@ -130,8 +130,11 @@
   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()
@@ -154,9 +157,9 @@
   //查询产品
   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)
   }