@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - Schema::create('company_applies', function (Blueprint $table) { |
|
13 | + Schema::create('company_applies', function(Blueprint $table) { |
|
14 | 14 | $table->uuid('id')->comment('主键'); |
15 | 15 | $table->enum('type', ['company', 'person'])->default('company')->comment('资料类型'); |
16 | 16 | $table->string("id_number")->comment("企业注册号/身份证号码"); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function up(): void |
13 | 13 | { |
14 | - Schema::create('companies', function (Blueprint $table) { |
|
14 | + Schema::create('companies', function(Blueprint $table) { |
|
15 | 15 | $table->uuid('id')->comment('主键'); |
16 | 16 | $table->foreignUuid('company_apply_id')->nullable()->comment('注册申请表ID'); |
17 | 17 | $table->string('name')->comment('名称'); |
@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - Schema::create('company_profiles', function (Blueprint $table) { |
|
13 | + Schema::create('company_profiles', function(Blueprint $table) { |
|
14 | 14 | $table->id(); |
15 | 15 | $table->foreignUuid('company_id')->constrained('companies')->comment("企业ID"); |
16 | 16 | $table->string("id_number")->comment("企业注册号/身份证号码"); |
@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - Schema::create('company_safes', function (Blueprint $table) { |
|
13 | + Schema::create('company_safes', function(Blueprint $table) { |
|
14 | 14 | $table->id('id')->comment("主键"); |
15 | 15 | $table->foreignUuid('company_account_id')->constrained('company_accounts')->nullable()->comment("账号ID"); |
16 | 16 | $table->enum('type', ['mobile', 'email'])->default('mobile')->comment("密保类型"); |
@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - Schema::create('company_accounts', function (Blueprint $table) { |
|
13 | + Schema::create('company_accounts', function(Blueprint $table) { |
|
14 | 14 | $table->uuid('id')->primary()->comment("主键"); |
15 | 15 | $table->foreignUuid('company_id')->constrained('companies')->nullable()->comment("公司ID"); |
16 | 16 | $table->string("account")->unique()->comment("登录账号"); |
@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - Schema::create('company_logs', function (Blueprint $table) { |
|
13 | + Schema::create('company_logs', function(Blueprint $table) { |
|
14 | 14 | $table->id()->comment("主键"); |
15 | 15 | $table->foreignUuid("company_id")->constrained('companies')->nullable()->comment("公司ID"); |
16 | 16 | $table->foreignUuid("company_account_id")->nullable()->comment("账号ID"); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $relationName = Str::plural(Str::camel(class_basename($modelClass))); |
76 | 76 | |
77 | 77 | // 动态添加 hasMany 关系 |
78 | - Company::resolveRelationUsing($relationName, function (Company $company) use ($modelClass) { |
|
78 | + Company::resolveRelationUsing($relationName, function(Company $company) use ($modelClass) { |
|
79 | 79 | return $company->hasMany($modelClass); |
80 | 80 | }); |
81 | 81 | } |
@@ -87,16 +87,16 @@ discard block |
||
87 | 87 | */ |
88 | 88 | protected function registerEvents(): void |
89 | 89 | { |
90 | - $this->app->bind('simplecms.plugin.company.api_login', function (CompanyAccount $account) { |
|
90 | + $this->app->bind('simplecms.plugin.company.api_login', function(CompanyAccount $account) { |
|
91 | 91 | return new ApiLogin($account); |
92 | 92 | }); |
93 | - $this->app->bind('simplecms.plugin.company.login_failed', function (CompanyAccount $account) { |
|
93 | + $this->app->bind('simplecms.plugin.company.login_failed', function(CompanyAccount $account) { |
|
94 | 94 | return new LoginFailed($account); |
95 | 95 | }); |
96 | - $this->app->bind('simplecms.plugin.company.login_success', function (CompanyAccount $account) { |
|
96 | + $this->app->bind('simplecms.plugin.company.login_success', function(CompanyAccount $account) { |
|
97 | 97 | return new LoginSuccess($account); |
98 | 98 | }); |
99 | - $this->app->bind('simplecms.plugin.company.company_request', function (Request $request, bool $status) { |
|
99 | + $this->app->bind('simplecms.plugin.company.company_request', function(Request $request, bool $status) { |
|
100 | 100 | return new CompanyRequest($request, $status); |
101 | 101 | }); |
102 | 102 | } |
@@ -89,7 +89,7 @@ |
||
89 | 89 | { |
90 | 90 | if (!$medias = $this->getMedia(self::MEDIA_FILE)) |
91 | 91 | return []; |
92 | - return $medias->map(function ($item) { |
|
92 | + return $medias->map(function($item) { |
|
93 | 93 | return [ |
94 | 94 | 'name' => $item->file_name, |
95 | 95 | 'url' => $item->original_url, |
@@ -116,7 +116,7 @@ |
||
116 | 116 | { |
117 | 117 | if (!$medias = $this->getMedia(self::MEDIA_FILE)) |
118 | 118 | return []; |
119 | - return $medias->map(function ($item) { |
|
119 | + return $medias->map(function($item) { |
|
120 | 120 | return [ |
121 | 121 | 'name' => $item->file_name, |
122 | 122 | 'url' => $item->original_url, |