Wijzigingen nav opmerking Peter 24-12-2018

This commit is contained in:
2019-01-02 16:57:41 +01:00
parent 9569522c83
commit efcd9f2c09
19 changed files with 201 additions and 44 deletions
+8 -2
View File
@@ -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();