projecten
This commit is contained in:
@@ -68,7 +68,7 @@ class Project extends BaseModel {
|
||||
'offers' => function ( $q ) {
|
||||
$q->whereArchive( 'F' )
|
||||
->with( [
|
||||
'payment' => function ( $q ) {
|
||||
'payments' => function ( $q ) {
|
||||
$q->selectRaw( '*' );
|
||||
}] );
|
||||
}] )
|
||||
@@ -76,6 +76,7 @@ class Project extends BaseModel {
|
||||
'projectemployees.user' => function ( $q ) {
|
||||
$q->selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" );
|
||||
}] )
|
||||
->with( 'projectemployees.projecthours' )
|
||||
->with( 'customer' );
|
||||
|
||||
return $project;
|
||||
@@ -83,10 +84,28 @@ class Project extends BaseModel {
|
||||
|
||||
public static function createProject()
|
||||
{
|
||||
$data = ['startdate'=> date('Y-m-d')];
|
||||
$data = ['startdate' => date( 'Y-m-d' )];
|
||||
|
||||
$project = Project::create($data);
|
||||
$project = Project::create( $data );
|
||||
|
||||
return $project->id;
|
||||
}
|
||||
|
||||
public static function saveProject( $projectID, $project )
|
||||
{
|
||||
$project = (array) $project;
|
||||
|
||||
if ( $projectID == 0 )
|
||||
{
|
||||
$project = Project::create( $project );
|
||||
$projectID = $project['id'];;
|
||||
}
|
||||
else
|
||||
{
|
||||
Project::whereId( $projectID )->update( $project );
|
||||
}
|
||||
|
||||
return $projectID;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user