fix: adjust active doctor appointment filter to default to true unless specified

This commit is contained in:
hamed
2026-06-21 18:02:03 +03:30
parent 21b6c583c0
commit 447ffc8862
+5 -4
View File
@@ -81,10 +81,11 @@ class DoctorRepository extends ServiceEntityRepository
if (!empty($filters['name'])) {
$qb->andWhere('d.name LIKE :name')->setParameter('name', '%' . $filters['name'] . '%');
}
if (isset($filters['active'])) {
$qb->andWhere('d.activeDoctorAppointment = :active')
->setParameter('active', (bool) $filters['active']);
}
// Public list shows only doctors with appointment enabled unless the
// caller explicitly asks otherwise (e.g. admin passing active=0).
$active = isset($filters['active']) ? (bool) $filters['active'] : true;
$qb->andWhere('d.activeDoctorAppointment = :active')
->setParameter('active', $active);
$qb->orderBy('d.doctorRate', $sort);