Fix score position and percentage

This commit is contained in:
Ruben 2016-09-05 12:12:58 +01:00
parent ed765541e9
commit 14b301849f

View file

@ -8,7 +8,7 @@ class GameRepository extends EntityRepository
{
public function getPositionForGame(Game $game) {
$query = $this->_em->createQuery(
"SELECT COUNT(g.id) FROM ". Game::class ." g WHERE g.score > :score AND g.level = :level"
"SELECT COUNT(g.id) + 1 FROM ". Game::class ." g WHERE g.score > :score AND g.level = :level"
)
->setParameters([
'score' => $game->getScore(),