Added lower to tag_categories search

This commit is contained in:
Matthew Barbour 2019-06-26 22:45:19 -05:00 committed by Shish
parent 8d567e9553
commit ac1196dee1

View File

@ -75,14 +75,14 @@ class TagCategories extends Extension
$types = $database->get_col('SELECT category FROM image_tag_categories');
if (in_array($type, $types)) {
$event->add_querylet(
new Querylet("EXISTS (
new Querylet($database->scoreql_to_sql("EXISTS (
SELECT 1
FROM image_tags it
LEFT JOIN tags t ON it.tag_id = t.id
WHERE images.id = it.image_id
GROUP BY image_id
HAVING SUM(CASE WHEN t.tag LIKE '$type:%' THEN 1 ELSE 0 END) $cmp $count
)")
HAVING SUM(CASE WHEN SCORE_STRNORM(t.tag) LIKE SCORE_STRNORM('$type:%') THEN 1 ELSE 0 END) $cmp $count
)"))
);
}
}