fix search

This commit is contained in:
Flummi 2022-05-22 11:18:34 +00:00
parent e68af4dc96
commit a9f65bb798

View File

@ -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}