{{ __('main.calculator_banklive') }}
@php
$defaultCurrency = isset($baseCurrency) ? $baseCurrency : 'USD';
$toCurrency = isset($toCurrency) ? $toCurrency : '';
if (!isset($marketCountry))
{
$currenciesCalculator = Cache::remember('currenciesCalculators', 999999999, function () {
return \App\Models\Currencies::whereHas('rates', function ($query) {
return $query->whereNotNull('current_price');
})
->where('is_active', 1)
->where('is_lost', 0)
->orderByRaw("CASE WHEN cur_code = 'EGP' THEN 1 ELSE 2 END")
->orderByDesc('cur_banks_support')
->get();
});
$topCurrencies = $currenciesCalculator->take(5); // أول 5 عملات
$otherCurrencies = $currenciesCalculator->slice(5); // باقي العملات
}else{
$otherCurrencies = Cache::remember('currenciesCalculators', 999999999, function () {
return \App\Models\Currencies::whereHas('rates', function ($query) {
return $query->whereNotNull('current_price');
})
->where('is_active', 1)
->where('is_lost', 0)
->get();
});
}
@endphp