projecten

This commit is contained in:
2018-01-18 08:45:09 +01:00
parent 00246f49f7
commit 970aa53971
25 changed files with 689 additions and 285 deletions
+3 -1
View File
@@ -26,12 +26,14 @@ class Offer extends BaseModel {
return $this->belongsTo( 'Customer' );
}
public static function getAllOffers( $archive = 'F' )
public static function getAllOffers( $projectID, $archive = 'F' )
{
$offers = Offer::orderBy( 'startdate' )
->with( 'customer' )
->with( 'project' );
if ( $projectID ) $offers = $offers->whereProjectId( $projectID );
if ( $archive == 'F' ) $offers = $offers->whereArchive( 'F' );
$offers = $offers->get();