From a5f2c707bf6d638c2526ca14373883064e68c759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Garnier?= Date: Tue, 10 Jan 2023 17:12:14 +0100 Subject: [PATCH] Correction d'erreur --- WEB/Model/UserModel.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WEB/Model/UserModel.php b/WEB/Model/UserModel.php index d4cae90c..f345eab4 100644 --- a/WEB/Model/UserModel.php +++ b/WEB/Model/UserModel.php @@ -106,11 +106,12 @@ class UserModel } public function enigmeMultiEnded(string $mailUtilisateur, int $enigmeId){ - $end_time = $_SESSION['tpsMaxPartie']; + $idPartie = $_SESSION['idPartie']; + $dateDebut = $this->partie_gateway->getDateDebut($idPartie); + $end_time = $dateDebut->modify('+'. $_SESSION['tpsMaxPartie'] .'seconds'); $now = new DateTime(); $interval = $now->diff($end_time); $tempDeResolution = $interval->days * 24 * 60 * 60 + $interval->h * 60 * 60 + $interval->i * 60 + $interval->s; - $idPartie = $_SESSION['idPartie']; $result = $this->resoudre_gateway->getMaxClassement($enigmeId, $idPartie); if ($result == 0){ $classement = 1;