From 4c8802f7bbed45290fb6b7932a7e25ac17bbb771 Mon Sep 17 00:00:00 2001 From: DonRenando Date: Wed, 18 Mar 2015 15:06:07 +0100 Subject: [PATCH] =?UTF-8?q?image=20al=C3=A9atoire=20et=20jeu=20non=20actif?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SRC/app/Http/Controllers/GameController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SRC/app/Http/Controllers/GameController.php b/SRC/app/Http/Controllers/GameController.php index 0f1372c..b679b88 100644 --- a/SRC/app/Http/Controllers/GameController.php +++ b/SRC/app/Http/Controllers/GameController.php @@ -32,13 +32,15 @@ class GameController extends Controller { $configjeu = Referent::find($idRef)->configjeu()->where('actifMemo', '=', '1')->first(); if($configjeu && count($configjeu->oeuvres) >= 1) { $oes = $configjeu->oeuvres; + $params = json_decode($configjeu->parametres); + $bloc = $params->{"m".$niveau}; } else { $oes = Oeuvre::orderByRaw("RAND()")->take(8)->get(); - $niveau = 1; + if($niveau == 1) {$bloc = 2;} elseif($niveau == 2){$bloc = 3;} else {$bloc = 4;} } - $params = json_decode($configjeu->parametres); - return view('frontend/memo', ['oeuvres' => $oes, 'niveau' => $niveau, 'nbBloc'=>$params->{"m".$niveau}]); + + return view('frontend/memo', ['oeuvres' => $oes, 'niveau' => $niveau, 'nbBloc'=>$bloc]); } public function chooseDifPuzzle() {