diff --git a/app/Models/Company.php b/app/Models/Company.php index 319c24c..8da3a96 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -7,12 +7,12 @@ class Company extends SoftDeletesModel protected $casts = ['project_users' => 'json']; - protected $appends = ['group_name', 'user_name']; + protected $appends = ['management_platform', 'project_manager']; /** * 管理平台 */ - public function getGroupNameAttribute() + public function getManagementPlatformAttribute() { $projectUsers = $this->project_users; if ($projectUsers) { @@ -27,7 +27,7 @@ class Company extends SoftDeletesModel * 管理人 * @return string|null */ - public function getUserNameAttribute() + public function getProjectManagerAttribute() { $projectUsers = $this->project_users; if ($projectUsers) { diff --git a/database/migrations/2025_11_11_140323_alert_companies_table.php b/database/migrations/2025_11_11_140323_alert_companies_table.php index 1fc4ec1..3d86c1f 100644 --- a/database/migrations/2025_11_11_140323_alert_companies_table.php +++ b/database/migrations/2025_11_11_140323_alert_companies_table.php @@ -15,7 +15,7 @@ return new class extends Migration { Schema::table('companies', function (Blueprint $table) { // 更新日期 - $table->dateTime('update_date')->useCurrent()->comment('更新日期'); + $table->dateTime('update_date')->nullable()->comment('更新日期'); // 管理平台 $table->json('project_users')->nullable()->comment('管理平台'); });