mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-29 13:03:52 +03:00
Fixed more coding styles
This commit is contained in:
parent
931bdb0cd7
commit
0d7a0ee9ea
1 changed files with 5 additions and 2 deletions
|
@ -24,6 +24,7 @@ use Shlinkio\Shlink\Importer\Model\ImportedShlinkUrl;
|
||||||
use function array_column;
|
use function array_column;
|
||||||
use function count;
|
use function count;
|
||||||
use function Functional\contains;
|
use function Functional\contains;
|
||||||
|
use function sprintf;
|
||||||
|
|
||||||
class ShortUrlRepository extends EntitySpecificationRepository implements ShortUrlRepositoryInterface
|
class ShortUrlRepository extends EntitySpecificationRepository implements ShortUrlRepositoryInterface
|
||||||
{
|
{
|
||||||
|
@ -136,10 +137,12 @@ class ShortUrlRepository extends EntitySpecificationRepository implements ShortU
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($filtering->excludeMaxVisitsReached) {
|
if ($filtering->excludeMaxVisitsReached) {
|
||||||
$visitEntity = Visit::class;
|
|
||||||
$qb->andWhere($qb->expr()->orX(
|
$qb->andWhere($qb->expr()->orX(
|
||||||
$qb->expr()->isNull('s.maxVisits'),
|
$qb->expr()->isNull('s.maxVisits'),
|
||||||
$qb->expr()->gt('s.maxVisits', "(SELECT COUNT(innerV.id) FROM $visitEntity as innerV WHERE innerV.shortUrl=s)"),
|
$qb->expr()->gt(
|
||||||
|
's.maxVisits',
|
||||||
|
sprintf('(SELECT COUNT(innerV.id) FROM %s as innerV WHERE innerV.shortUrl=s)', Visit::class),
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue