auth(); $this->user = User::create([ "password" => hashid_encode("111111"), "email" => "liantiao@lientiao.com", "status" => User::STATUS_OK, "group_id" => 1, "phone" => 15012341234, "extra" => [ "permissions" => [1, 2], ], ]); User::create([ "password" => hashid_encode("111111"), "email" => "normal@lientiao.com", "status" => User::STATUS_OK, "group_id" => 2, "phone" => 13012341234, ]); $this->company(); Setting::create([ "type" => Setting::TYPE_BANNER, "key" => "banner1", "value" => json_encode(["is_use" => 1, "imageUrl" => "https://fendi-liaona.oss-cn-hangzhou.aliyuncs.com/yimei/logo/20230427/0db2bfbd1d3eccd33e03894128efdab1.png", "sort" => 9]), ]); } public function company() { UserCompany::create(["name" => "测试企业", "tax_no" => "ooxx", "user_id" => $this->user->id]); } private function auth() { AdminGroup::truncate(); AdminPermission::truncate(); AdminGroup::create(["name" => "超级管理员"]); AdminGroup::create(["name" => "普通管理员"]); AdminGroup::create(["name" => "员工"]); AdminPermission::create(["name" => "权限1", "code" => "code1"]); AdminPermission::create(["name" => "权限2", "code" => "code2"]); } }