diff --git a/src/Models/SearchServices/TagSearchService.php b/src/Models/SearchServices/TagSearchService.php index ea7f18a3..60f3ab1f 100644 --- a/src/Models/SearchServices/TagSearchService.php +++ b/src/Models/SearchServices/TagSearchService.php @@ -69,7 +69,8 @@ class TagSearchService extends AbstractSearchService { $stmt = (new Sql\SelectStatement) ->setTable('post_tag') - ->addColumn('tag_id') + ->addInnerJoin('tag', new Sql\EqualsFunctor('post_tag.tag_id', 'tag.id')) + ->addColumn('tag.*') ->addColumn(new Sql\AliasFunctor(new Sql\CountFunctor('post_tag.post_id'), 'post_count')) ->setGroupBy('post_tag.tag_id') ->setOrderBy('post_count', Sql\SelectStatement::ORDER_DESC)