From a9f65bb798521e5edfa2792f2e0f382beb579bd7 Mon Sep 17 00:00:00 2001 From: Flummi Date: Sun, 22 May 2022 11:18:34 +0000 Subject: [PATCH] fix search --- src/inc/routes/search.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/inc/routes/search.mjs b/src/inc/routes/search.mjs index 9d83553..5ffad83 100644 --- a/src/inc/routes/search.mjs +++ b/src/inc/routes/search.mjs @@ -17,7 +17,7 @@ export default (router, tpl) => { total = (await db` select count(*) as total from "items" - where src ilike ${'%' + tag.substring(4) + '%'} + where src ilike ${'%' + tag.substring(4) + '%'} and active = 'true' group by "items".id `).length; } @@ -42,7 +42,7 @@ export default (router, tpl) => { from "items" where src ilike ${'%' + tag.substring(4) + '%'} and - active = 1 + active = 'true' group by "items".id order by "items".id desc offset ${offset} @@ -55,7 +55,7 @@ export default (router, tpl) => { from "tags" left join "tags_assign" on "tags_assign".tag_id = "tags".id left join "items" on "items".id = "tags_assign".item_id - where "tags".tag ilike ${'%' + tag + '%'} and "items".active = 1 + where "tags".tag ilike ${'%' + tag + '%'} and "items".active = 'true' group by "items".id, "tags".tag offset ${offset} limit ${_eps}