Coba ini:
$rateEruToDolor =2;
$rateAedToDolor =3;
$products = Product::join('product_options', 'products.id', '=', 'product_options.product_id')
->join('options', 'product_options.option_id', '=', 'options.id')
->selectRaw('price, currency, IF(currency=0, price * ?, IF(currency=1, price * ?, price))
as dolor_price', [$rateEruToDolor, $rateAedToDolor]);
$products->orderBy('dolor_price');
dd($products->get()->toArray());
Cantumkan semua bidang di tabel produk/opsi Anda bersama dengan price
dan currency
sudah terdaftar di selectRaw('xxx, xxx, price, currency, IF ...)
cara diatas. Semoga membantu