diversen nav opmerkingen

This commit is contained in:
2018-03-21 17:23:58 +01:00
parent 3241cc0c67
commit e89dc41e18
23 changed files with 404 additions and 154 deletions
+11 -4
View File
@@ -23,15 +23,22 @@ class Employeehour extends BaseModel {
public static function getEmployeehours( $month, $year )
{
$employeehours = Employeehour::whereRaw( "MONTH(hourdate) ={$month} AND YEAR(hourdate) = {$year}" )
$employeehours = Employeehour::whereRaw( "MONTH(hourdate) = " . ( $month + 1 ) . " AND YEAR(hourdate) = {$year}" )
->with( [
'user' => function ( $q ) {
$q->selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" );
}] )
->with( 'hourtype' )
->get();
->with( 'hourtype' );
return $employeehours;
$projecthours = Employeehour::whereRaw("MONTH(hourdate) = " . ( $month + 1 ) . " AND YEAR(hourdate) = {$year}" )->with( [
'user' => function ( $q ) {
$q->selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" );
}] )
->with( 'hourtype' );
$results = $employeehours->union($projecthours)->get();
return $results;
}
public static function saveEmployeehour( $employeehourID, $data )