diversen nav opmerkingen
This commit is contained in:
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user