save employeehours with uuid
This commit is contained in:
@@ -41,19 +41,20 @@ class Employeehour extends BaseModel {
|
||||
return $results;
|
||||
}
|
||||
|
||||
public static function saveEmployeehour( $employeehourID, $data )
|
||||
public static function saveEmployeehour( $data )
|
||||
{
|
||||
if ( $employeehourID == 0 )
|
||||
$record = Employeehour::whereUuid( $data['uuid'])->first();
|
||||
if ( ! $record )
|
||||
{
|
||||
$employeehour = Employeehour::create( $data );
|
||||
|
||||
$employeehourID = $employeehour->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
Employeehour::whereId( $employeehourID )->update( $data );
|
||||
Employeehour::whereUuid( $data['uuid'] )->update( $data );
|
||||
$employeehourID = FALSE;
|
||||
}
|
||||
|
||||
return $employeehourID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user