新增seed
This commit is contained in:
parent
dd46a28096
commit
8084e11805
@ -1 +1,39 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Seeder;
|
||||
|
||||
class DepartmentsSeed 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 = [
|
||||
[
|
||||
'id' => 1,
|
||||
'department_name' => '总部',
|
||||
'parent_id' => 0,
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'department_name' => '北京总部',
|
||||
'parent_id' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'department_name' => '南京总部',
|
||||
'parent_id' => 1,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($data as $item) {
|
||||
\catchAdmin\permissions\model\Department::create($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ class PermissionSeed extends Seeder
|
||||
'id' => 2,
|
||||
'permission_name' => '主页',
|
||||
'parent_id' => 1,
|
||||
'route' => '/dashboard/workplac',
|
||||
'route' => '/dashboard/workplace',
|
||||
'icon' => '',
|
||||
'module' => 'index',
|
||||
'creator_id' => 1,
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use think\migration\Seeder;
|
||||
|
||||
class DepartmentsSeed extends Seeder
|
||||
class ConfigSeed extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run Method.
|
||||
@ -16,24 +16,21 @@ class DepartmentsSeed extends Seeder
|
||||
{
|
||||
$data = [
|
||||
[
|
||||
'id' => 1,
|
||||
'department_name' => '总部',
|
||||
'parent_id' => 0,
|
||||
'name' => '基础配置',
|
||||
'pid' => 0,
|
||||
'component' => 'basic',
|
||||
'key' => 'basic',
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'department_name' => '北京总部',
|
||||
'parent_id' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'department_name' => '南京总部',
|
||||
'parent_id' => 1,
|
||||
'name' => '上传配置',
|
||||
'pid' => 0,
|
||||
'component' => 'upload',
|
||||
'key' => 'upload',
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($data as $item) {
|
||||
\catchAdmin\permissions\model\Department::create($item);
|
||||
\catchAdmin\system\model\Config::create($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user