conflicts

This commit is contained in:
2019-10-25 16:52:12 +02:00
parent d0069061ba
commit 7345f3ca1f
3 changed files with 26 additions and 12 deletions
+13 -2
View File
@@ -82,8 +82,8 @@ class Project extends BaseModel {
{
$project = Project::getBaseProject();
$project = $project->whereArchive( 'F' )
->whereId( $projectID )
$project = $project->whereId( $projectID )
// ->whereArchive( 'F' )
->first();
return $project;
@@ -183,4 +183,15 @@ class Project extends BaseModel {
self::whereId( $offer->project_id )
->update( ['projectname' => $offer->offername] );
}
public static function getProjectsWithExternalCosts( $projects )
{
$projectCosts = self::selectRAW( 'projects.id, OFF.costs' )
->join( 'offers AS OFF', 'OFF.project_id', '=', 'projects.id' )
->whereNotIn( 'projects.id', $projects )
->where( 'OFF.costs', '>', 0 )
->get();
return $projectCosts;
}
}