文章可设置类型用于不同而类型

This commit is contained in:
augushong
2020-05-07 21:33:59 +08:00
parent 642dc3a568
commit c4dcc1f6b6
14 changed files with 57 additions and 42 deletions

View File

@@ -45,7 +45,7 @@ class CreateTablePost extends Migrator
$table->addColumn(ColumnFormat::stringUrl('jump_to_url')->setComment('跳转链接'));
$table->addColumn(ColumnFormat::integerTypeStatus('jump_to_url_status')->setComment('0:不显示,1:显示连接,2:自动跳转'));
$table->addColumn(ColumnFormat::integer('sort')->setComment('排序,越大越靠前'));
$table->addColumn(ColumnFormat::integerTypeStatus('type')->setComment('类型,1:文章,有分类有标签,2:页面,无分类无标签'));
$table->addColumn(ColumnFormat::integerTypeStatus('type',1)->setComment('类型,1:文章,有分类有标签,2:页面,无分类无标签,N:其他形式用,用于区分不同的用途'));
$table->addColumn(Column::make('files','text')->setComment('附件'));
$table->addColumn(Column::make('pictures','text')->setComment('相册'));
$table->addColumn(ColumnFormat::stringShort('tpl_name')->setComment('模板名称'));

View File

@@ -30,20 +30,22 @@ class CreateTableCategory extends Migrator
public function change()
{
$table = $this->table('category')
->setComment('分类表')
->addColumn(ColumnFormat::stringNormal('title'))
->addColumn(ColumnFormat::timestamp('create_time'))
->addColumn(ColumnFormat::timestamp('update_time'))
->addColumn(ColumnFormat::timestamp('delete_time'))
->addColumn(ColumnFormat::integer('pid')->setComment('上级id'))
->addColumn(ColumnFormat::integer('level')->setDefault(1)->setComment('层级'))
->addColumn(ColumnFormat::stringShort('tpl_name')->setComment('模板名称'))
->addColumn(ColumnFormat::stringUrl('title_img')->setComment('附图'))
->addColumn(ColumnFormat::stringLong('desc')->setComment('副标题描述'))
->addColumn(ColumnFormat::integerTypeStatus('status')->setComment('0:不显示,1:显示'))
->addIndex('pid')
->addIndex('status')
->addIndex('delete_time')
->create();
->setComment('分类表')
->addColumn(ColumnFormat::stringNormal('title'))
->addColumn(ColumnFormat::timestamp('create_time'))
->addColumn(ColumnFormat::timestamp('update_time'))
->addColumn(ColumnFormat::timestamp('delete_time'))
->addColumn(ColumnFormat::integer('pid')->setComment('上级id'))
->addColumn(ColumnFormat::integer('level')->setDefault(1)->setComment('层级'))
->addColumn(ColumnFormat::stringShort('tpl_name')->setComment('模板名称'))
->addColumn(ColumnFormat::stringUrl('title_img')->setComment('附图'))
->addColumn(ColumnFormat::stringLong('desc')->setComment('副标题描述'))
->addColumn(ColumnFormat::integerTypeStatus('status')->setComment('0:不显示,1:显示'))
->addColumn(ColumnFormat::integerTypeStatus('type',1)->setComment('类型,1:文章,有分类有标签,2:页面,无分类无标签,N:其他形式用,用于区分不同的用途'))
->addIndex('type')
->addIndex('pid')
->addIndex('status')
->addIndex('delete_time')
->create();
}
}

View File

@@ -30,11 +30,13 @@ class CreateTableTag extends Migrator
public function change()
{
$table = $this->table('tag')
->setComment('分类表')
->addColumn(ColumnFormat::stringNormal('title'))
->addColumn(ColumnFormat::timestamp('create_time'))
->addColumn(ColumnFormat::timestamp('update_time'))
->addColumn(ColumnFormat::timestamp('delete_time'))
->create();
->setComment('分类表')
->addColumn(ColumnFormat::stringNormal('title'))
->addColumn(ColumnFormat::timestamp('create_time'))
->addColumn(ColumnFormat::timestamp('update_time'))
->addColumn(ColumnFormat::timestamp('delete_time'))
->addColumn(ColumnFormat::integerTypeStatus('type',1)->setComment('类型,1:文章,有分类有标签,2:页面,无分类无标签,N:其他形式用,用于区分不同的用途'))
->addIndex('type')
->create();
}
}