recover
This commit is contained in:
36
catch/system/database/seeds/ConfigSeed.php
Normal file
36
catch/system/database/seeds/ConfigSeed.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Seeder;
|
||||
|
||||
class ConfigSeed extends Seeder
|
||||
{
|
||||
/**
|
||||
* 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 = [
|
||||
[
|
||||
'name' => '基础配置',
|
||||
'pid' => 0,
|
||||
'component' => 'basis',
|
||||
'key' => 'basis',
|
||||
],
|
||||
[
|
||||
'name' => '上传配置',
|
||||
'pid' => 0,
|
||||
'component' => 'upload',
|
||||
'key' => 'upload',
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($data as $item) {
|
||||
\catchAdmin\system\model\Config::create($item);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user