Test calcul classement
continuous-integration/drone/push Build is failing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent 71aebe1432
commit 95ee6cd658

@ -309,13 +309,13 @@ class ResoudreGateway
$query="SELECT classement FROM Resoudre
WHERE enigme=:enigme
AND partie=:partie
ORDER BY classement DESC LIMIT 1";
ORDER BY classement";
$this->con->executeQuery($query, array(
"enigme" => array($enigmeId, SQLITE3_INTEGER),
"partie" => array($idPartie, SQLITE3_INTEGER)));
$results=$this->con->getResults();
if (empty($results) || $results[0]['classement'] == null) {
return array(0);
return array(null);
}
foreach ($results as $row) {
$classement[] = $row['classement'];

@ -127,15 +127,10 @@ class UserModel
$tempDeResolution = $interval->days * 24 * 60 * 60 + $interval->h * 60 * 60 + $interval->i * 60 + $interval->s;
// $result = $this->resoudre_gateway->getMaxClassement($enigmeId, $idPartie);
$leClassement = $this->resoudre_gateway->getClassement($enigmeId, $idPartie);
if ($leClassement[0] == 0){
$classement = 1;
}
else{
for ($i = 1; $i < $playerNumberPerGame; $i++){
if ($leClassement[$i] == null){
$classement = $i + 1;
break;
}
for ($i = 0; $i < $playerNumberPerGame; $i++){
if ($leClassement[$i] == null || $leClassement[$i] != $i + 1){
$classement = $i + 1;
break;
}
}
// if ($result == 0){

Loading…
Cancel
Save