Wijzigingen nav opmerking Peter 24-12-2018
This commit is contained in:
@@ -26,15 +26,18 @@ class Offer extends BaseModel {
|
||||
return $this->belongsTo( 'Customer' );
|
||||
}
|
||||
|
||||
public static function getAllOffers( $projectID, $archive = 'F' )
|
||||
public static function getAllOffers( $projectID, $archive = 'F', $search, $order, $direction )
|
||||
{
|
||||
$offers = Offer::orderBy( 'startdate' )
|
||||
$offers = Offer::selectRAW('offers.*')
|
||||
->join('customers AS CUS', 'CUS.id', '=', 'offers.customer_id')
|
||||
->with( 'customer' )
|
||||
->with( 'project' );
|
||||
->with( 'project' )
|
||||
->where('offernumber', 'LIKE', "%{$search}%")
|
||||
->orderBy($order, $direction);
|
||||
|
||||
if ( $projectID ) $offers = $offers->whereProjectId( $projectID );
|
||||
|
||||
if ( $archive == 'F' ) $offers = $offers->whereArchive( 'F' );
|
||||
if ( $archive == 'F' ) $offers = $offers->where( 'offers.archive', '=', 'F' );
|
||||
|
||||
$offers = $offers->get();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user