Skip to content
Snippets Groups Projects
Commit 2b5361cb authored by Tondon César's avatar Tondon César
Browse files

partie 2

parent 6e9d62d5
No related branches found
No related tags found
No related merge requests found
...@@ -17,29 +17,31 @@ class IndexController ...@@ -17,29 +17,31 @@ class IndexController
} }
public static function partie2() { public static function partie2() {
$game = Game::where('id','<=','200')->get(); $game = Game::select('id','name','alias','deck')->where('id','<=','200')->get();
// $game = Game::where('id','=',1)->get(); // $game = Game::where('id','=',1)->get();
// $json = json_encode($game,JSON_FORCE_OBJECT); // $json = json_encode($game,JSON_FORCE_OBJECT);
$json = '{ "games" : [ '; $json = '{ "games" : [ ';
foreach($game as $key => $value) { foreach($game as $key => $value) {
$json = $json . '{ $json = $json . json_encode($value) . ',';
"id": ' . $value->id . ', /*$json = $json . '{
"name":' . $value->name . ', "id": ' . $value->id . ',
"deck":' . $value->deck . ', "name":' . $value->name . ',
}, "deck":' . $value->deck . ',
'; },
if ($value->id == 200) { ';*/
$json = $json . '{ if ($value->id == 200) {
"id": ' . $value->id . ', $json = $json . json_encode($value);/*
"name":' . $value->name . ', $json = $json . '{
"deck":' . $value->deck . ', "id": ' . $value->id . ',
} "name":' . $value->name . ',
'; "deck":' . $value->deck . ',
} }
} ';*/
$json = $json . ']}'; }
$cq2 = new VuePartie2($json); }
$cq2->render(); $json = $json . ']}';
$cq2 = new VuePartie2($json);
$cq2->render();
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment