feat: add owner mobile information to ClinicsPage and update API to fetch owner mobile
This commit is contained in:
@@ -461,11 +461,13 @@ class AdminApiController extends BaseController
|
||||
$offset = ($page - 1) * $limit;
|
||||
$rows = $conn->fetchAllAssociative(
|
||||
"SELECT c.uuid, c.name, c.telephone, c.clinic_logo, c.is_active, c.created_at,
|
||||
COUNT(DISTINCT cd.doctor_id) as doctors_count
|
||||
COUNT(DISTINCT cd.doctor_id) as doctors_count,
|
||||
u.mobile_number as owner_mobile
|
||||
FROM clinics c
|
||||
LEFT JOIN clinic_doctors cd ON cd.clinic_id = c.id
|
||||
LEFT JOIN users u ON u.id = c.user_id
|
||||
WHERE $whereStr
|
||||
GROUP BY c.id
|
||||
GROUP BY c.id, u.mobile_number
|
||||
ORDER BY c.created_at DESC
|
||||
LIMIT $limit OFFSET $offset",
|
||||
$params
|
||||
@@ -479,6 +481,7 @@ class AdminApiController extends BaseController
|
||||
'is_active' => (bool) $c['is_active'],
|
||||
'doctors_count' => (int) $c['doctors_count'],
|
||||
'created_at' => (int) $c['created_at'],
|
||||
'owner_mobile' => $c['owner_mobile'],
|
||||
], $rows);
|
||||
|
||||
return $this->paginated($items, $total, $page, $limit);
|
||||
|
||||
Reference in New Issue
Block a user