added distance calculation from location
This commit is contained in:
@@ -51,7 +51,10 @@ public class Routes {
|
|||||||
posts
|
posts
|
||||||
WHERE
|
WHERE
|
||||||
deleted IS NULL
|
deleted IS NULL
|
||||||
AND sqrt(power(postlocation[0] - (?), 2) + power(postlocation[1] - (?), 2)) <= 10
|
AND AND earth_distance(
|
||||||
|
ll_to_earth(posts.postlocation[0], posts.postlocation[1]),
|
||||||
|
ll_to_earth((?), (?))
|
||||||
|
) <= 10000
|
||||||
AND posts.id NOT IN (SELECT child FROM comments)
|
AND posts.id NOT IN (SELECT child FROM comments)
|
||||||
UNION
|
UNION
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Reference in New Issue
Block a user