added distance calculation from location
This commit is contained in:
@@ -51,7 +51,10 @@ public class Routes {
|
||||
posts
|
||||
WHERE
|
||||
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)
|
||||
UNION
|
||||
SELECT
|
||||
|
||||
Reference in New Issue
Block a user