Commit 17477067 authored by テクニカル諏訪子's avatar テクニカル諏訪子 🍂

都道府県UP!

parent 81c191c9
......@@ -26,7 +26,7 @@ class NihonController extends Controller {
}
public function getGeoPrefecture () {
$get = DB::table('nhn_prefecture')->get();
$get = DB::table('nhn_prefecture')->get()->toArray();
foreach ($get as $g) {
$r = DB::table('nhn_region')->where('id', $g->region_id)->first();
......@@ -40,6 +40,16 @@ class NihonController extends Controller {
unset($g->region_id); unset($r->island_id);
}
array_unshift($get, array(
'id' => 0,
'name' => '',
'nameKana' => '',
'nameEng' => '',
'prefcode' => '',
'region' => array('name' => '', 'nameKana' => '', 'nameEng' => ''),
'island' => array('name' => '', 'nameKana' => '', 'nameEng' => '')
));
return $get;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment