diversen
This commit is contained in:
@@ -21,6 +21,16 @@ class Project extends BaseModel {
|
||||
return $this->hasMany( 'Projectemployee' );
|
||||
}
|
||||
|
||||
public function projectcosts()
|
||||
{
|
||||
return $this->hasMany( 'Projectcost' );
|
||||
}
|
||||
|
||||
public function invoices()
|
||||
{
|
||||
return $this->hasMany( 'Invoice' );
|
||||
}
|
||||
|
||||
public function projectleader()
|
||||
{
|
||||
return $this->belongsTo( 'User', 'projectleader_id' );
|
||||
@@ -66,17 +76,16 @@ class Project extends BaseModel {
|
||||
}] )
|
||||
->with( [
|
||||
'offers' => function ( $q ) {
|
||||
$q->whereArchive( 'F' )
|
||||
->with( [
|
||||
'payments' => function ( $q ) {
|
||||
$q->selectRaw( '*' );
|
||||
}] );
|
||||
$q->whereArchive( 'F' );
|
||||
}] )
|
||||
->with( [
|
||||
'projectemployees.user' => function ( $q ) {
|
||||
$q->selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" );
|
||||
}] )
|
||||
->with( 'projectemployees.projecthours' )
|
||||
->with( 'projectcosts.external' )
|
||||
->with( 'invoices.payments' )
|
||||
->with( 'invoices.vat' )
|
||||
->with( 'customer' );
|
||||
|
||||
return $project;
|
||||
|
||||
Reference in New Issue
Block a user