fix: correct filtering of assignments by staffing count
This commit is contained in:
@@ -67,6 +67,7 @@ class AssignmentFilterType extends AbstractType
|
||||
'choices' => [
|
||||
'voll besetzt' => Assignment::STATUS_STAFFED,
|
||||
'teilweise besetzt' => Assignment::STATUS_PARTLY_STAFFED,
|
||||
'unbesetzt' => Assignment::STATUS_UNSTAFFED,
|
||||
'mit Bewerbungen' => Assignment::STATUS_STAFFING,
|
||||
],
|
||||
]);
|
||||
|
||||
@@ -87,8 +87,8 @@ class AssignmentRepository extends ServiceEntityRepository
|
||||
break;
|
||||
case Assignment::STATUS_PARTLY_STAFFED:
|
||||
$qb
|
||||
->having('assignment.availableDispositions > COUNT(disposition.id)')
|
||||
->andHaving('COUNT(application.id) = 0')
|
||||
->having('COUNT(disposition.id) > 0')
|
||||
->andHaving('assignment.availableDispositions > COUNT(disposition.id)')
|
||||
;
|
||||
break;
|
||||
case Assignment::STATUS_STAFFING:
|
||||
@@ -98,7 +98,7 @@ class AssignmentRepository extends ServiceEntityRepository
|
||||
;
|
||||
break;
|
||||
case Assignment::STATUS_UNSTAFFED:
|
||||
$qb->having('assignment.availableDispositions > COUNT(disposition.id)');
|
||||
$qb->having('COUNT(disposition.id) = 0');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user