From c9ca11d412703363021d32e665100ff0d0c2969f Mon Sep 17 00:00:00 2001 From: leca Date: Sat, 17 Aug 2024 13:20:28 +0300 Subject: [PATCH] fix2 --- src/user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/user.js b/src/user.js index 7629332..215e1e4 100644 --- a/src/user.js +++ b/src/user.js @@ -128,15 +128,15 @@ export class User { AND NOT EXISTS(SELECT sender, recipient FROM read_profiles WHERE sender = $2 AND recipient = room_id) AND ${myinterest !== 'b' ? "sex = $3" : "$3 = $3 AND $4 = $4 AND $5 = $5 AND $6 = $6 AND $7 = $7"} AND ${myrange !== 0 ? - `location = ANY(ARRAY(SELECT ID + `(location = ANY(ARRAY(SELECT ID FROM cities WHERE check_distance($6::double precision, $7::double precision, lat, lng, $5::double precision) AND (check_distance($6::double precision, $7::double precision, lat, lng, range) OR range = 0) - ))` + )))` : - `range = 0 OR - check_distance($6::double precision, $7::double precision, (SELECT lat FROM cities WHERE ID = location), (SELECT lng FROM cities WHERE ID = location), range)` + `(range = 0 OR + check_distance($6::double precision, $7::double precision, (SELECT lat FROM cities WHERE ID = location), (SELECT lng FROM cities WHERE ID = location), range))` } AND (interest = $4 OR interest = 'b') ORDER BY RANDOM()