Wijzigingen nav opmerking Peter 24-12-2018
This commit is contained in:
@@ -61,11 +61,17 @@ class Project extends BaseModel {
|
||||
return $this->belongsTo( 'Customer' );
|
||||
}
|
||||
|
||||
public static function getAllProjects( $archive = 'F' )
|
||||
public static function getAllProjects( $archive, $search, $order, $direction )
|
||||
{
|
||||
$projects = Project::getBaseProject();
|
||||
|
||||
if ( $archive == 'F' ) $projects = $projects->whereArchive( 'F' );
|
||||
$projects = $projects->selectRaw('projects.*')
|
||||
->join('customers AS CUS', 'CUS.id', '=', 'projects.customer_id')
|
||||
->join('users AS USR', 'USR.id', '=', 'projects.projectleader_id')
|
||||
->where('projects.projectnumber', 'LIKE', "%{$search}%")
|
||||
->orderBy($order, $direction);
|
||||
|
||||
if ( $archive == 'F' ) $projects = $projects->where( 'projects.archive', '=', 'F' );
|
||||
|
||||
$projects = $projects->get();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user