初始字段

$fields = [
    'term_name'        => 'termName',
    'term_slug'        => 'termSlug',
    'term_info'        => 'termInfo',
    'term_module'      => 'demo',
    'term_controll'    => 'category',//固定值
    'term_action'      => 'index',
    'term_status'      => 'normal',
    'term_type'        => '',
    'term_order'       => 1,
    'term_parent'      => 0,
    'term_count'       => 0,
    'term_title'       => '',
    'term_kewords'     => '',
    'term_description' => '',
];

卸载插件时删除栏目分类

model('common/Category','loglic')->uninstall('demo');

安装插件时批量插入一级分类

model('common/Category','loglic')->install([
    [
        'term_name'       => '分类1',
        'term_slug'       => 'category1',
        'term_module'     => 'demo',
        'term_type'       => 'navbar',//是否作为导航栏显示
        'term_tpl'        => 'index',//动态扩展的表单字段
    ],
    [
        'term_name'       => '分类2',
        'term_slug'       => 'category2',
        'term_module'     => 'demo',
        'term_type'       => 'navbar',//是否作为导航栏显示
        'term_tpl'        => 'index',//动态扩展的表单字段
    ],
]);

安装插件时批量插入二级分类

model('common/Category','loglic')->install([
    [
        'term_name'       => '分类3',
        'term_slug'       => 'category3',
        'term_module'     => 'demo',
        'term_type'       => 'navbar',//是否作为导航栏显示
        'term_tpl'        => 'index',//动态扩展的表单字段
    ],
    [
        'term_name'       => '分类4',
        'term_slug'       => 'category4',
        'term_module'     => 'demo',
        'term_type'       => 'navbar',//是否作为导航栏显示
        'term_tpl'        => 'index',//动态扩展的表单字段
    ],
],'分类1');