This commit is contained in:
2018-01-16 13:36:59 +01:00
parent 97f1b988bc
commit 00246f49f7
10 changed files with 248 additions and 41 deletions
+14 -1
View File
@@ -32,12 +32,25 @@ class Project extends BaseModel {
'projectleader' => function ( $q ) {
$q->selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" );
}] )
->with( [
'offers' => function ( $q ) {
$q->whereArchive( 'F' )
->with( [
'payment' => function ( $q ) {
$q->selectRaw( '*' );
}] );
}] )
->with( 'customer' );
if($archive == 'F') $projects = $projects->whereArchive('F');
if ( $archive == 'F' ) $projects = $projects->whereArchive( 'F' );
$projects = $projects->get();
return $projects;
}
public static function removeProject( $projectID )
{
Project::whereId($projectID)->delete();
}
}