mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Changed point in which specs are applied for tags list
This commit is contained in:
parent
df53e6c6f2
commit
6e1d6ab795
1 changed files with 5 additions and 1 deletions
|
@ -31,13 +31,17 @@ class TagRepository extends EntitySpecificationRepository implements TagReposito
|
|||
*/
|
||||
public function findTagsWithInfo(?Specification $spec = null): array
|
||||
{
|
||||
$qb = $this->getQueryBuilder($spec, 't');
|
||||
$qb = $this->createQueryBuilder('t');
|
||||
$qb->select('t AS tag', 'COUNT(DISTINCT s.id) AS shortUrlsCount', 'COUNT(DISTINCT v.id) AS visitsCount')
|
||||
->leftJoin('t.shortUrls', 's')
|
||||
->leftJoin('s.visits', 'v')
|
||||
->groupBy('t')
|
||||
->orderBy('t.name', 'ASC');
|
||||
|
||||
if ($spec !== null) {
|
||||
$this->applySpecification($qb, $spec, 't');
|
||||
}
|
||||
|
||||
$query = $qb->getQuery();
|
||||
|
||||
return map(
|
||||
|
|
Loading…
Add table
Reference in a new issue