<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use ModStart\Core\Dao\ModelUtil; use Module\Vendor\Tecmz\Type\ExpressCompany; class CreateShippingCompany extends Migration { public function up() { goto DN_9c; asIUs: $i0YzC = 1; goto VH04A; VH04A: $MCyeh = array(); goto JxpHu; JxpHu: foreach (ExpressCompany::getList() as $KAKiA => $Iim2u) { $MCyeh[] = array('sort' => $i0YzC++, 'active' => true, 'code' => $KAKiA, 'name' => $Iim2u); } goto WsOIv; DN_9c: Schema::create('shipping_company', function (Blueprint $onV5E) { $onV5E->increments('id'); $onV5E->timestamps(); $onV5E->integer('sort')->nullable()->comment('排序'); $onV5E->tinyInteger('active')->nullable()->comment('启用'); $onV5E->string('code', 100)->nullable()->comment('代码'); $onV5E->string('name', 100)->nullable()->comment('名称'); $onV5E->index(array('sort')); }); goto asIUs; WsOIv: ModelUtil::insertAll('shipping_company', $MCyeh); goto NFVeg; NFVeg: } public function down() { } }