This commit is contained in:
ivan-sim
2024-10-17 14:14:05 +07:00
parent 81a47bfb07
commit e4253756e4

View File

@@ -244,9 +244,9 @@ class ApotekController extends Controller
return $item;
});
$apotek_phone = DB::connection('mysql')->table('organizations')
->leftJoin('addresses', 'addresses.id','=', 'organizations.main_address_id')
// ->leftJoin('addresses', 'addresses.id','=', 'organizations.main_address_id')
->whereIn('organizations.id', $apotekIds)
->pluck('addresses.phone', 'organizations.id');
->pluck('organizations.phone', 'organizations.id');
$results->getCollection()->transform(function ($item) use ($apotek_phone) {
$item->phone_apotek = $apotek_phone->get($item->nIDApotek, '-'); // Default to 'Unknown' if not found
return $item;