mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-14 01:15:35 +01:00
Sort by id is faster
Since it's the primary key
This commit is contained in:
parent
0c83fd5994
commit
2385f891e5
@ -26,7 +26,7 @@ class EntryRepository extends EntityRepository
|
||||
->leftJoin('e.user', 'u')
|
||||
->where('e.isArchived = false')
|
||||
->andWhere('u.id =:userId')->setParameter('userId', $userId)
|
||||
->orderBy('e.createdAt', 'desc')
|
||||
->orderBy('e.id', 'desc')
|
||||
->getQuery();
|
||||
|
||||
$paginator = new Paginator($qb);
|
||||
@ -52,7 +52,7 @@ class EntryRepository extends EntityRepository
|
||||
->leftJoin('e.user', 'u')
|
||||
->where('e.isArchived = true')
|
||||
->andWhere('u.id =:userId')->setParameter('userId', $userId)
|
||||
->orderBy('e.createdAt', 'desc')
|
||||
->orderBy('e.id', 'desc')
|
||||
->getQuery();
|
||||
|
||||
$paginator = new Paginator($qb);
|
||||
@ -78,7 +78,7 @@ class EntryRepository extends EntityRepository
|
||||
->leftJoin('e.user', 'u')
|
||||
->where('e.isStarred = true')
|
||||
->andWhere('u.id =:userId')->setParameter('userId', $userId)
|
||||
->orderBy('e.createdAt', 'desc')
|
||||
->orderBy('e.id', 'desc')
|
||||
->getQuery();
|
||||
|
||||
$paginator = new Paginator($qb);
|
||||
@ -111,7 +111,7 @@ class EntryRepository extends EntityRepository
|
||||
}
|
||||
|
||||
if ('created' === $sort) {
|
||||
$qb->orderBy('e.createdAt', $order);
|
||||
$qb->orderBy('e.id', $order);
|
||||
} elseif ('updated' === $sort) {
|
||||
$qb->orderBy('e.updatedAt', $order);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user