chg: usr: fine-tune the recent battle list #8
Deploy to Production / deploy (push) Successful in 27s

This commit is contained in:
Lang
2026-04-21 13:57:44 +02:00
parent 69fce52bed
commit 1d8efa4e61
4 changed files with 22 additions and 7 deletions
+12 -2
View File
@@ -40,9 +40,19 @@ class RecentBattleRepository extends ServiceEntityRepository
public function findRecentForUser(int $userId, int $limit = 30): array
{
return $this->createQueryBuilder('rb')
->where('rb.userId = :uid')
$qb = $this->createQueryBuilder('rb');
return $qb
->where($qb->expr()->eq('rb.userId', ':uid'))
->andWhere(
$qb->expr()->orX(
$qb->expr()->eq('rb.oppIsGuest', ':false'),
$qb->expr()->isNotNull('rb.redPoints'),
$qb->expr()->isNotNull('rb.bluePoints')
),
)
->setParameter('uid', $userId)
->setParameter('false', false)
->orderBy('rb.updated', 'DESC')
->setMaxResults($limit)
->getQuery()