Improved query
This commit is contained in:
parent
59cff3511b
commit
71a398277d
|
@ -181,7 +181,7 @@ class Search extends BaseApi
|
||||||
|
|
||||||
$params = ['order' => ['name'], 'limit' => [$offset, $limit]];
|
$params = ['order' => ['name'], 'limit' => [$offset, $limit]];
|
||||||
|
|
||||||
$condition = ["`id` IN (SELECT `tid` FROM `post-tag` WHERE `type` = ? AND `tid` = `id`) AND `name` LIKE ?", Tag::HASHTAG, $q . '%'];
|
$condition = ["EXISTS(SELECT `tid` FROM `post-tag` WHERE `type` = ? AND `tid` = `id`) AND `name` LIKE ?", Tag::HASHTAG, $q . '%'];
|
||||||
|
|
||||||
$tags = DBA::select('tag', ['name'], $condition, $params);
|
$tags = DBA::select('tag', ['name'], $condition, $params);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user