This commit is contained in:
2018-06-11 08:17:01 +02:00
parent c539d03fb6
commit 4954d6fcca
2 changed files with 14 additions and 15 deletions
+6 -4
View File
@@ -16,6 +16,11 @@ class Project extends BaseModel {
return $this->hasMany( 'Offer' );
}
public function offer()
{
return $this->hasOne( 'Offer' );
}
public function projectemployees()
{
return $this->hasMany( 'Projectemployee' );
@@ -105,10 +110,7 @@ class Project extends BaseModel {
'projectleader' => function ( $q ) {
$q->selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" );
}] )
->with( [
'offers' => function ( $q ) {
$q->whereArchive( 'F' );
}] )
->with( 'offer' )
->with( [
'projectemployees.user' => function ( $q ) {
$q->selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" );