Restult table - mod
This commit is contained in:
@@ -45,15 +45,8 @@ class ProductsCompareController extends Controller
|
||||
if (count($countries)) $products->whereIn("country",$countries);
|
||||
$products = $products->get();
|
||||
|
||||
$currencyRates = CurrencyRates::rates2EUR("Y");
|
||||
if ($currency == "EUR") {
|
||||
$coef = 1;
|
||||
} else {
|
||||
$coef = floatval(CurrencyRates::where('currency',$currency)->first()->rate);
|
||||
}
|
||||
|
||||
$products = $products->map(function ($product) use ($currencyRates, $coef, $cHash) {
|
||||
$product["salesPrice"] = round(floatval(($product["salesPrice"]) / $currencyRates[$product["country"]]) * $coef, 2);
|
||||
$products = $products->map(function ($product) use ( $cHash) {
|
||||
$product["countryName"] = $cHash[$product["country"]];
|
||||
return $product;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user