diff --git a/cmd/auto-transfer-products-to-farm/main.go b/cmd/auto-transfer-products-to-farm/main.go index 221b5ad3..865c554d 100644 --- a/cmd/auto-transfer-products-to-farm/main.go +++ b/cmd/auto-transfer-products-to-farm/main.go @@ -316,7 +316,7 @@ func loadFarmWarehouseMap(ctx context.Context, db *gorm.DB, opts *commandOptions Select(` kw.location_id AS location_id, l.name AS location_name, - COUNT(fw.id) AS farm_count, + COUNT(DISTINCT fw.id) AS farm_count, MIN(fw.id) AS warehouse_id, MIN(fw.name) AS warehouse_name `).