Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Commit

Permalink
update distance to 15 miles
Browse files Browse the repository at this point in the history
  • Loading branch information
James Baxley committed Sep 18, 2016
1 parent 7e0e2e4 commit 1c1ed48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rock/models/groups/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public async findByAttributesAndQuery({ attributes, query }, { limit, offset, ge
g.Name,
l.[GeoPoint].STDistance(geography::Point(${point})) AS Distance,
SUM(gt.TagValue) as RawValue,
SUM(gt.TagValue) - ISNULL(CONVERT(INT, l.[GeoPoint].STDistance(geography::Point(${point})) / @metersPerMile / 10), 1000) AS Score
SUM(gt.TagValue) - ISNULL(CONVERT(INT, l.[GeoPoint].STDistance(geography::Point(${point})) / @metersPerMile / 15), 1000) AS Score
FROM #groupTags gt
JOIN [Group] g ON g.Id = gt.GroupId
LEFT JOIN [GroupLocation] gl ON gl.GroupId = g.Id
Expand All @@ -391,7 +391,7 @@ public async findByAttributesAndQuery({ attributes, query }, { limit, offset, ge
g.Name,
l.[GeoPoint].STDistance(geography::Point(${point}))
ORDER BY
SUM(gt.TagValue) - ISNULL(CONVERT(INT, l.[GeoPoint].STDistance(geography::Point(${point})) / @metersPerMile / 10), 1000) DESC,
SUM(gt.TagValue) - ISNULL(CONVERT(INT, l.[GeoPoint].STDistance(geography::Point(${point})) / @metersPerMile / 15), 1000) DESC,
l.[GeoPoint].STDistance(geography::Point(${point})) ASC;
`).then(([x]) => x)
)
Expand Down

0 comments on commit 1c1ed48

Please sign in to comment.