38 lines
1.3 KiB
PHP
Raw Normal View History

2020-06-25 08:35:52 +08:00
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
2020-06-25 08:36:59 +08:00
use think\migration\Seeder;
class RolesSeed 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
*/
2024-01-08 10:20:20 +08:00
public function run(): void
2020-06-25 08:36:59 +08:00
{
\catchAdmin\permissions\model\Roles::create([
'role_name' => '超级管理员',
2020-09-08 14:31:30 +08:00
'identify' => 'admin',
2020-06-25 08:36:59 +08:00
'description' => 'super user',
2020-09-08 14:31:30 +08:00
'data_range' => 1,
2020-06-25 08:36:59 +08:00
'creator_id' => 1,
]);
\think\facade\Db::name( 'user_has_roles')->insert([
'role_id' => 1,
'uid' => 1,
]);
}
}