mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-28 09:03:07 +03:00
Use short_url_visits_counts table when excluding short URLs which reached max visits
This commit is contained in:
parent
d6f58698b7
commit
f92a720d63
1 changed files with 4 additions and 1 deletions
|
@ -147,7 +147,10 @@ class ShortUrlListRepository extends EntitySpecificationRepository implements Sh
|
||||||
$qb->expr()->isNull('s.maxVisits'),
|
$qb->expr()->isNull('s.maxVisits'),
|
||||||
$qb->expr()->gt(
|
$qb->expr()->gt(
|
||||||
's.maxVisits',
|
's.maxVisits',
|
||||||
sprintf('(SELECT COUNT(innerV.id) FROM %s as innerV WHERE innerV.shortUrl=s)', Visit::class),
|
sprintf(
|
||||||
|
'(SELECT COALESCE(SUM(vc.count), 0) FROM %s as vc WHERE vc.shortUrl=s)',
|
||||||
|
ShortUrlVisitsCount::class,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue