['type' => 'string_60', 'title' => '账号名称'], 'real_username' => ['type' => 'string_60', 'title' => '真实姓名'], 'avatar' => ['type' => 'string', 'title' => '头像', 'is_null' => 1], 'roles' => ['type' => 'json', 'title' => '角色', 'is_null' => 1], 'unionid' => ['type' => 'string_60', 'title' => '微信unionid'], 'status' => ['type' => 'string_60', 'title' => '状态', 'remark' => '1 启用 2 禁用'], 'remark' => ['type' => 'string', 'title' => '备注'], ]; } /** * 初始化内容 */ public function init() { DB::table($this->schema)->insert([ 'mid' => Str::random(12), 'created_at' => time(), 'updated_at' => time(), 'username' => 'tty', 'real_username' => '李磊', 'avatar' => '', 'roles' => json_encode([1, 2]), 'unionid' => '', 'status' => 1, 'remark' => '', ]); } /** * Run the database seeds. * * @return void */ public function run() { $this->schema = 'user'; $this->title = '用户表'; $this->start(); } }