From e77b69fbc5067bb8a46e193cadaa0c5233991307 Mon Sep 17 00:00:00 2001 From: Ruben Date: Tue, 1 Nov 2016 21:17:01 +0100 Subject: [PATCH] Add rand ordering --- src/Models/HitRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/HitRepository.php b/src/Models/HitRepository.php index 77c1815..9cd5d9f 100644 --- a/src/Models/HitRepository.php +++ b/src/Models/HitRepository.php @@ -39,7 +39,7 @@ class HitRepository extends EntityRepository } $query = $this->_em->createQuery( - "SELECT h, ABS(:score - h.emotions.$emotionField) as HIDDEN distance FROM ".Hit::class." h WHERE h.hasImage = :has ORDER BY distance ASC, RAND() " + "SELECT h, ABS(:score - h.emotions.$emotionField) as HIDDEN distance, RAND() AS HIDDEN rand FROM ".Hit::class." h WHERE h.hasImage = :has ORDER BY distance ASC, rand" ) ->setParameters([ 'score' => $score,