diff --git a/src/Api/InterfaceControllerProvider.php b/src/Api/InterfaceControllerProvider.php index 6d5547b..c2f43c0 100644 --- a/src/Api/InterfaceControllerProvider.php +++ b/src/Api/InterfaceControllerProvider.php @@ -149,7 +149,7 @@ class InterfaceControllerProvider implements ControllerProviderInterface return $blocks; }; - $features = ['brows' => 6, 'nose' => 5, 'mouth' => 8]; + $features = ['brows' => $_GET['brows'] ?? 6, 'nose' => $_GET['nose'] ?? 5, 'mouth' => $_GET['mouth'] ?? 8]; $output = []; diff --git a/src/Models/HitRepository.php b/src/Models/HitRepository.php index 4dc9ad4..73048e2 100644 --- a/src/Models/HitRepository.php +++ b/src/Models/HitRepository.php @@ -40,7 +40,7 @@ class HitRepository extends EntityRepository $query = $this->_em->createQuery( // add BETWEEN so we can use _some_ keying to improve performance. - "SELECT h, ABS(:score - h.emotions.$emotionField) as HIDDEN distance, RAND() AS HIDDEN lala FROM ".Hit::class." h WHERE h.hasImage = :has AND h.emotions.$emotionField BETWEEN :score - 5 AND :score + 5 ORDER BY distance ASC, lala" + "SELECT h, ABS(:score - h.emotions.$emotionField) as HIDDEN distance, RAND() AS HIDDEN lala FROM ".Hit::class." h WHERE h.hasImage = :has AND h.emotions.$emotionField BETWEEN :score - 2 AND :score + 2 ORDER BY distance ASC, lala" ) ->setParameters([ 'score' => $score,