fix query hospital dashboard and search

This commit is contained in:
Muhammad Fajar
2022-11-03 05:28:07 +07:00
parent ba3b6a583d
commit 0115d3fbb3
4 changed files with 17 additions and 10 deletions

View File

@@ -18,8 +18,8 @@ class HospitalResource extends JsonResource
'id' => $this->id,
'name' => $this->name,
'address' => $this->address ?? null,
'distance' => isset($this->distance_km) ? round($this->distance_km) . ' km' : null,
'city_name' => $this->currentAddress->city->name ?? null,
'distance' => $this->distance ? ($this->distance < 1 ? round($this->distance * 1000, 2) . " m" : round($this->distance, 2) . " km") : null,
'city_name' => $this->city_name ?? null,
'phone' => $this->meta->phone,
'photos' => [
'title' => $this->name,