Diversen
This commit is contained in:
@@ -23,6 +23,19 @@ class Projectemployee extends BaseModel {
|
||||
return $this->hasMany( 'Projecthour' );
|
||||
}
|
||||
|
||||
public static function getAvailableEmployees( $projectID )
|
||||
{
|
||||
$currentEmployees = Self::whereProjectId( $projectID )
|
||||
->lists( 'user_id' );
|
||||
|
||||
$availableEmployees = User::selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" )
|
||||
->whereNotIn( 'id', $currentEmployees )
|
||||
->whereArchive( 'F' )
|
||||
->get();
|
||||
|
||||
return $availableEmployees;
|
||||
}
|
||||
|
||||
public static function createProjectEmployee( $projectID )
|
||||
{
|
||||
$projectemployee = Projectemployee::create( [
|
||||
|
||||
Reference in New Issue
Block a user