fix(wallet,assets): fix 3 extra zeros in wallet rial value and handle closed market in asset calculations

This commit is contained in:
2026-11-19 11:00:41 +03:30
parent ce9d62ffaa
commit 070acd52e0
5 changed files with 143 additions and 18 deletions
+3
View File
@@ -844,6 +844,9 @@ class ZaarboxPriceService
if ($copper !== null && $dollar !== null) {
$cp = (int) round(($copper / 1000000) * $dollar);
if ($cp > 500_000_000) {
$cp = (int) round($cp / 1000);
}
$copperProducts = Product::where('metal_id', 3)->get();
foreach ($copperProducts as $copperProduct) {
ProductPriceService::syncFromReference($copperProduct, $cp, 0);