<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class UpdateAreaChinaData extends Migration { public function up() { goto LIron; pXiW_: \ModStart\Core\Dao\ModelManageUtil::truncate('area_china'); goto cLaOi; HPc5R: \ModStart\Core\Dao\ModelUtil::insertAll('area_china', $bV27O); goto t1ncY; FuzKe: $f3Ivk = @json_decode(file_get_contents(__DIR__ . '/../Data/areas.json'), true); goto pJ20Y; HN1Hd: $bV27O = @json_decode(file_get_contents(__DIR__ . '/../Data/cities.json'), true); goto FuzKe; LIron: $Z2Twu = @json_decode(file_get_contents(__DIR__ . '/../Data/provinces.json'), true); goto HN1Hd; t1ncY: \ModStart\Core\Dao\ModelUtil::insertAll('area_china', $f3Ivk); goto YBSqf; duV6n: $f3Ivk = array_map(function ($vetOJ) { return array('id' => $vetOJ['code'], 'pid' => $vetOJ['cityCode'], 'sort' => $vetOJ['code'], 'title' => $vetOJ['name']); }, $f3Ivk); goto pXiW_; aIuIb: $bV27O = array_map(function ($vetOJ) { return array('id' => $vetOJ['code'], 'pid' => $vetOJ['provinceCode'], 'sort' => $vetOJ['code'], 'title' => $vetOJ['name']); }, $bV27O); goto duV6n; cLaOi: \ModStart\Core\Dao\ModelUtil::insertAll('area_china', $Z2Twu); goto HPc5R; pJ20Y: $Z2Twu = array_map(function ($vetOJ) { return array('id' => $vetOJ['code'], 'pid' => 0, 'sort' => $vetOJ['code'], 'title' => $vetOJ['name']); }, $Z2Twu); goto aIuIb; YBSqf: } public function down() { } }