fix dashboardcontroller query & resources doctors
This commit is contained in:
@@ -28,9 +28,11 @@ class DashboardController extends Controller
|
|||||||
])
|
])
|
||||||
->where('active', 1)
|
->where('active', 1)
|
||||||
->whereNot('speciality_id')
|
->whereNot('speciality_id')
|
||||||
->get(['id', 'speciality_id'])
|
->get(['id', 'practitioner_id', 'speciality_id'])
|
||||||
->random($limit);
|
->random($limit);
|
||||||
|
|
||||||
|
return $queryDoctors;
|
||||||
|
|
||||||
$data = DoctorResourceDashboard::collection($queryDoctors);
|
$data = DoctorResourceDashboard::collection($queryDoctors);
|
||||||
} elseif ($query === 'hospitals') {
|
} elseif ($query === 'hospitals') {
|
||||||
$queryHospitals = Organization::query()
|
$queryHospitals = Organization::query()
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ class DoctorResource extends JsonResource
|
|||||||
public function toArray($request)
|
public function toArray($request)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'id' => $this->practitioner->person->id,
|
'id' => $this->practitioner_id,
|
||||||
'name' => $this->practitioner->person->name,
|
'name' => $this->person->name ?? '',
|
||||||
'specialis' => "Spesialis " . $this->speciality->name,
|
'specialis' => "Spesialis " . $this->speciality->name ?? '',
|
||||||
'photos' => [
|
'photos' => [
|
||||||
'title' => 'doctors-avatar-' . $this->id,
|
'title' => 'doctors-avatar-' . $this->practitioner_id,
|
||||||
'url' => asset('images/default-doctor-avatar.png')
|
'url' => asset('images/default-doctor-avatar.png')
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user