37 lines
809 B
PHP
Raw Normal View History

2020-04-21 19:56:44 +08:00
<?php
use think\migration\Seeder;
2020-04-21 21:06:53 +08:00
class ConfigSeed extends Seeder
2020-04-21 19:56:44 +08:00
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run()
{
$data = [
[
2020-04-21 21:06:53 +08:00
'name' => '基础配置',
'pid' => 0,
2020-04-21 22:22:27 +08:00
'component' => 'basis',
2020-04-21 21:23:58 +08:00
'key' => 'basis',
2020-04-21 19:56:44 +08:00
],
[
2020-04-21 21:06:53 +08:00
'name' => '上传配置',
'pid' => 0,
'component' => 'upload',
'key' => 'upload',
2020-04-21 19:56:44 +08:00
],
];
foreach ($data as $item) {
2020-04-21 21:06:53 +08:00
\catchAdmin\system\model\Config::create($item);
2020-04-21 19:56:44 +08:00
}
}
}