refactor: 修改国家及语言表和模型
This commit is contained in:
@@ -20,6 +20,7 @@ class CountryBaseModel extends Model
|
|||||||
protected $schema = [
|
protected $schema = [
|
||||||
'id' => 'int',
|
'id' => 'int',
|
||||||
'name' => 'string',
|
'name' => 'string',
|
||||||
|
'en_name' => 'string',
|
||||||
'code' => 'string',
|
'code' => 'string',
|
||||||
'icon' => 'string',
|
'icon' => 'string',
|
||||||
'status' => 'int',
|
'status' => 'int',
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class LanguageBaseModel extends BaseModel
|
|||||||
'id' => 'int',
|
'id' => 'int',
|
||||||
'country_id' => 'int',
|
'country_id' => 'int',
|
||||||
'name' => 'string',
|
'name' => 'string',
|
||||||
|
'en_name' => 'string',
|
||||||
'code' => 'string',
|
'code' => 'string',
|
||||||
'icon' => 'string',
|
'icon' => 'string',
|
||||||
'url' => 'string',
|
'url' => 'string',
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class CreateSysLanguage extends Migrator
|
|||||||
$table = $this->table('sys_language', ['engine' => 'MyISAM', 'comment' => '语言表']);
|
$table = $this->table('sys_language', ['engine' => 'MyISAM', 'comment' => '语言表']);
|
||||||
$table->addColumn('country_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '国家ID'])
|
$table->addColumn('country_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '国家ID'])
|
||||||
->addColumn('name', 'string', ['limit' => 64, 'null' => false, 'default' => '', 'comment' => '语言名称'])
|
->addColumn('name', 'string', ['limit' => 64, 'null' => false, 'default' => '', 'comment' => '语言名称'])
|
||||||
|
->addColumn('en_name', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'comment' => '语言名称英文'])
|
||||||
->addColumn('code', 'string', ['limit' => 64, 'null' => false, 'default' => '', 'comment' => '语言编码'])
|
->addColumn('code', 'string', ['limit' => 64, 'null' => false, 'default' => '', 'comment' => '语言编码'])
|
||||||
->addColumn('icon', 'string', ['limit' => 64, 'default' => null, 'comment' => '语言图标'])
|
->addColumn('icon', 'string', ['limit' => 64, 'default' => null, 'comment' => '语言图标'])
|
||||||
->addColumn('url', 'string', ['limit' => 125, 'default' => null, 'comment' => '切换后访问的url'])
|
->addColumn('url', 'string', ['limit' => 125, 'default' => null, 'comment' => '切换后访问的url'])
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class CreateSysCountry extends Migrator
|
|||||||
{
|
{
|
||||||
$table = $this->table('sys_country', ['engine' => 'MyISAM', 'comment' => '国家表']);
|
$table = $this->table('sys_country', ['engine' => 'MyISAM', 'comment' => '国家表']);
|
||||||
$table->addColumn('name', 'string', ['limit' => 120, 'null' => false, 'default' => '', 'comment' => '国家名称'])
|
$table->addColumn('name', 'string', ['limit' => 120, 'null' => false, 'default' => '', 'comment' => '国家名称'])
|
||||||
|
->addColumn('en_name', 'string', ['limit' => 120, 'null' => true, 'default' => null, 'comment' => '国家英文名称'])
|
||||||
->addColumn('code', 'string', ['limit' => 64, 'null' => false, 'default' => '', 'comment' => '国家代码'])
|
->addColumn('code', 'string', ['limit' => 64, 'null' => false, 'default' => '', 'comment' => '国家代码'])
|
||||||
->addColumn('icon', 'string', ['limit' => 64, 'default' => null, 'comment' => '国家图标'])
|
->addColumn('icon', 'string', ['limit' => 64, 'default' => null, 'comment' => '国家图标'])
|
||||||
->addColumn('status', 'boolean', ['default' => 1, 'comment' => '状态:1启用,0禁用'])
|
->addColumn('status', 'boolean', ['default' => 1, 'comment' => '状态:1启用,0禁用'])
|
||||||
|
|||||||
Reference in New Issue
Block a user