Working query filter for co2s

This commit is contained in:
2020-07-03 09:42:44 -04:00
parent a9a024d35e
commit d107cc8e8b
2 changed files with 38 additions and 18 deletions
+10 -7
View File
@@ -72,18 +72,21 @@ namespace LeafWeb.WebCms.Utility
lid.Site.Longitude <= longitude + range)
select li;
}
// co2s
if (!string.IsNullOrEmpty(query.co2s))
{
var co2s = double.Parse(query.co2s);
var p = double.Parse(query.co2s);
resultItems =
from li in resultItems
where co2s >=
li.LeafInputData.Max(lid =>
lid.Data.Max(d => d.CO2S) -
lid.Data.Min(d => d.CO2S)
)
where
// maximum range inside LeafInputFiles
li.LeafInputData.Max(lid =>
// range of LeafInputData
lid.Data.Max(d => d.CO2S)
- lid.Data.Min(d => d.CO2S))
>= p
select li;
}