feat: add export functionality for JSON data in CategoriesPage and update TabActions component
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Doctor\Repository;
|
||||
use App\Auth\Entity\User;
|
||||
use App\Clinic\Entity\Clinic;
|
||||
use App\Doctor\Entity\Doctor;
|
||||
use App\Doctor\Entity\DoctorAddress;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\Query\Expr\Join;
|
||||
use Doctrine\ORM\Tools\Pagination\Paginator;
|
||||
@@ -48,13 +49,17 @@ class DoctorRepository extends ServiceEntityRepository
|
||||
->leftJoin('d.specialties', 's')
|
||||
->leftJoin('d.provinces', 'pr')
|
||||
->leftJoin('d.cities', 'ci')
|
||||
->leftJoin(Clinic::class, 'cl', Join::WITH, 'd MEMBER OF cl.doctors')
|
||||
->leftJoin(DoctorAddress::class, 'ca', Join::WITH, 'ca.clinicId = cl.id AND ca.doctor IS NULL')
|
||||
->distinct();
|
||||
|
||||
if (!empty($filters['state'])) {
|
||||
$qb->andWhere('pr.id = :state')->setParameter('state', (int) $filters['state']);
|
||||
$qb->andWhere('pr.id = :state OR IDENTITY(ca.province) = :state')
|
||||
->setParameter('state', (int) $filters['state']);
|
||||
}
|
||||
if (!empty($filters['city'])) {
|
||||
$qb->andWhere('ci.id = :city')->setParameter('city', (int) $filters['city']);
|
||||
$qb->andWhere('ci.id = :city OR IDENTITY(ca.city) = :city')
|
||||
->setParameter('city', (int) $filters['city']);
|
||||
}
|
||||
if (!empty($filters['specialty'])) {
|
||||
$qb->andWhere('s.id = :specialty')->setParameter('specialty', (int) $filters['specialty']);
|
||||
|
||||
Reference in New Issue
Block a user