12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace Database\Seeders\Backend;
- use Database\Seeders\BaseSeeder;
- use Txj\Elastic\Facades\Eav;
- class AdminRoleSeeder extends BaseSeeder
- {
- public function getColumnData()
- {
- return [
- 'name' => ['type' => 'string_60', 'title' => '名称'],
- 'status' => ['type' => 'string_60', 'title' => '状态', 'remark' => '1 启用'],
- 'remark' => ['type' => 'string', 'title' => '备注'],
- 'privileges' => ['type' => 'object', 'title' => '权限', 'is_null' => 1,],
- ];
- }
- public function init()
- {
- Eav::table($this->schema)->insert([
- 'name' => '超级管理员',
- 'remark' => '超级管理员,拥有所有权限',
- 'status' => 1,
- 'privileges' => [],
- ]);
- }
- /**
- * Run the database seeds.
- *
- * @return void
- */
- public function run()
- {
- $this->schema = 'admin_role';
- $this->title = '管理员角色表';
- // $this->category_type = 2;
- $this->start();
- }
- }
|