|
|
|
|
@ -5,9 +5,9 @@ namespace App\Models;
|
|
|
|
|
class Company extends SoftDeletesModel
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
protected $casts = ['project_users' => 'json'];
|
|
|
|
|
protected $casts = ['project_users' => 'json', 'partners' => 'json'];
|
|
|
|
|
|
|
|
|
|
protected $appends = ['management_platform', 'project_manager'];
|
|
|
|
|
protected $appends = ['management_platform', 'project_manager', 'invest_date'];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 管理平台
|
|
|
|
|
@ -38,6 +38,21 @@ class Company extends SoftDeletesModel
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 出资时间
|
|
|
|
|
* @return string|null
|
|
|
|
|
*/
|
|
|
|
|
public function getInvestDateAttribute()
|
|
|
|
|
{
|
|
|
|
|
$projectUsers = $this->project_users;
|
|
|
|
|
if ($projectUsers) {
|
|
|
|
|
$investDateArray = array_column($projectUsers, 'investDate');
|
|
|
|
|
$investDate = implode(',', $investDateArray);
|
|
|
|
|
return $investDate;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function users()
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(User::class, 'company_id', 'id');
|
|
|
|
|
|