Fixed most used tag retrieving
This commit is contained in:
parent
9cc8d03376
commit
72821157dd
1 changed files with 2 additions and 1 deletions
|
@ -69,7 +69,8 @@ class TagSearchService extends AbstractSearchService
|
||||||
{
|
{
|
||||||
$stmt = (new Sql\SelectStatement)
|
$stmt = (new Sql\SelectStatement)
|
||||||
->setTable('post_tag')
|
->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'))
|
->addColumn(new Sql\AliasFunctor(new Sql\CountFunctor('post_tag.post_id'), 'post_count'))
|
||||||
->setGroupBy('post_tag.tag_id')
|
->setGroupBy('post_tag.tag_id')
|
||||||
->setOrderBy('post_count', Sql\SelectStatement::ORDER_DESC)
|
->setOrderBy('post_count', Sql\SelectStatement::ORDER_DESC)
|
||||||
|
|
Loading…
Reference in a new issue