From 9d0bf46defc266a4cf84c3c904bfc74c6f698c50 Mon Sep 17 00:00:00 2001 From: johan Date: Tue, 3 Jan 2023 18:14:28 +0100 Subject: [PATCH] corrections --- WEB/Controller/PartieGateway.php | 3 ++- WEB/Controller/UserController.php | 8 +++----- WEB/Model/UserModel.php | 4 ++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/WEB/Controller/PartieGateway.php b/WEB/Controller/PartieGateway.php index 0e983213..1230cc56 100644 --- a/WEB/Controller/PartieGateway.php +++ b/WEB/Controller/PartieGateway.php @@ -66,7 +66,8 @@ class PartieGateway $query = "SELECT p.id FROM Partie p, Participer pa WHERE pa.etat=0 - AND pa.partie=p.id"; + AND pa.partie=p.id + LIMIT 1"; $this->con->executeQuery($query); $results = $this->con->getResults(); return $results[0]['id']; diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index 1fbc508b..15f2a79f 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -205,12 +205,10 @@ class UserController require($rep . $vues['queue']); $model = new UserModel(); $model->addToQueue(); + $usergroup = $model->findUserGroup(); echo - ''; } + public function findUserGroup() : int { + return $this->partie_gateway->findPartieInQueue(); + } + public function launchGame() { $this->utilisateur_gateway->launchGame($_SESSION['utilisateur']);