diff --git a/src/Form/AssignmentFilterType.php b/src/Form/AssignmentFilterType.php index 08555b5..4fee226 100644 --- a/src/Form/AssignmentFilterType.php +++ b/src/Form/AssignmentFilterType.php @@ -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, ], ]); diff --git a/src/Repository/AssignmentRepository.php b/src/Repository/AssignmentRepository.php index 1fe5510..d0edd5b 100644 --- a/src/Repository/AssignmentRepository.php +++ b/src/Repository/AssignmentRepository.php @@ -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; } }