Skip to content

Commit ebf9e6d

Browse files
committed
ガキが・・・コケてると潰すぞRevert "OR -> UNION"
This reverts commit 67e3a4d.
1 parent 67e3a4d commit ebf9e6d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

isuumo/webapp/nodejs/app.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -564,14 +564,8 @@ app.get("/api/recommended_estate/:id", async (req, res, next) => {
564564
const edges = [chair.width, chair.height, chair.depth].sort((a, b) => b - a);
565565
const w = edges[1]
566566
const h = edges[2]
567-
const sql = `
568-
SELECT * FROM (
569-
SELECT * FROM estate WHERE door_width >= ? AND door_height>= ?
570-
UNION
571-
SELECT * FROM estate WHERE door_width >= ? AND door_height>= ?
572-
) t ORDER BY popularity DESC, id ASC LIMIT ?`
573567
const es = await query(
574-
sql,
568+
"SELECT * FROM estate where (door_width >= ? AND door_height>= ?) OR (door_width >= ? AND door_height>= ?) ORDER BY popularity DESC, id ASC LIMIT ?",
575569
[w, h, h, w, LIMIT]
576570
);
577571
const estates = es.map((estate) => camelcaseKeys(estate));

0 commit comments

Comments
 (0)