From 72821157ddd4a68131f5de02469645cc597c5e3c Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 11 May 2014 21:57:41 +0200 Subject: [PATCH] Fixed most used tag retrieving --- src/Models/SearchServices/TagSearchService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)