mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-29 04:52:54 +03:00
Fixed error when using postgres in a SELECT count query where a ORDER BY was added by mistake
This commit is contained in:
parent
425f254453
commit
0f81c3ab92
1 changed files with 3 additions and 3 deletions
|
@ -50,7 +50,8 @@ DQL;
|
||||||
?int $offset = null
|
?int $offset = null
|
||||||
): array {
|
): array {
|
||||||
$qb = $this->createVisitsByShortCodeQueryBuilder($shortCode, $dateRange);
|
$qb = $this->createVisitsByShortCodeQueryBuilder($shortCode, $dateRange);
|
||||||
$qb->select('v');
|
$qb->select('v')
|
||||||
|
->orderBy('v.date', 'DESC');
|
||||||
|
|
||||||
if ($limit !== null) {
|
if ($limit !== null) {
|
||||||
$qb->setMaxResults($limit);
|
$qb->setMaxResults($limit);
|
||||||
|
@ -76,8 +77,7 @@ DQL;
|
||||||
$qb->from(Visit::class, 'v')
|
$qb->from(Visit::class, 'v')
|
||||||
->join('v.shortUrl', 'su')
|
->join('v.shortUrl', 'su')
|
||||||
->where($qb->expr()->eq('su.shortCode', ':shortCode'))
|
->where($qb->expr()->eq('su.shortCode', ':shortCode'))
|
||||||
->setParameter('shortCode', $shortCode)
|
->setParameter('shortCode', $shortCode);
|
||||||
->orderBy('v.date', 'DESC') ;
|
|
||||||
|
|
||||||
// Apply date range filtering
|
// Apply date range filtering
|
||||||
if ($dateRange !== null && $dateRange->getStartDate() !== null) {
|
if ($dateRange !== null && $dateRange->getStartDate() !== null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue