fix some bugs

This commit is contained in:
2026-07-27 21:01:18 +03:30
parent 26f78005fc
commit d8256b3f20
3 changed files with 18 additions and 23 deletions
@@ -228,7 +228,7 @@ class ReportController extends Controller
$closed = false;
$montzar_price = 0;
$montzarLivePrice = 0;
$zaarbox_price = 0;
$pr_price = 0;
@@ -350,11 +350,11 @@ class ReportController extends Controller
$montzar_open_buy = $montzarFlags['open_buy'];
$montzar_open_sell = $montzarFlags['open_sell'];
$montzar_price = (int) $customPrice['price'];
$montzarLivePrice = (int) $customPrice['price'];
$config->UpdateConfig('montzar_closed', 'false');
} catch (\Throwable $e) {
$montzar_price = 0;
$montzarLivePrice = 0;
\Log::error('MONZAR PRICE ERROR', [
'message' => $e->getMessage(),
@@ -364,7 +364,7 @@ class ReportController extends Controller
$config->applyMontzarSyncFailure();
if (!$config->getBool('montzar_closed', true)) {
$montzar_price = $config->getInt('montzar_live_price', 0);
$montzarLivePrice = $config->getInt('montzar_live_price', 0);
}
}
}
@@ -415,8 +415,8 @@ class ReportController extends Controller
if ($priceProvider === 'zaarbox' && $zaarbox_price > 0 && !$closed) {
$priceValue = $zaarbox_price;
$priceSource = 'zaarbox';
} elseif ($priceProvider === 'montzar' && ($montzar_price ?? 0) !== 0 && !$closed) {
$priceValue = (int) $montzar_price;
} elseif ($priceProvider === 'montzar' && ($montzarLivePrice ?? 0) !== 0 && !$closed) {
$priceValue = (int) $montzarLivePrice;
$priceSource = 'montzar';
} elseif ($priceProvider === 'main_product' && ($pr_price ?? 0) !== 0 && !$closed) {
$priceValue = $pr_price;
@@ -443,7 +443,7 @@ class ReportController extends Controller
'price_last' => 0,
'price' => 0,
'main_product' => $pr_price ?? 0,
'montzar' => $montzar_price ?? 0,
'montzar' => $montzarLivePrice ?? 0,
'zaarbox' => $zaarbox_price ?? 0,
'closed' => false,
'status' => 'no_quote',
@@ -489,7 +489,7 @@ class ReportController extends Controller
'price' => $priceValue,
'price_source' => $priceSource,
'main_product' => $pr_price ?? 0,
'montzar' => $montzar_price ?? 0,
'montzar' => $montzarLivePrice ?? 0,
'zaarbox' => $zaarbox_price ?? 0,
'closed' => false,
'time' => now(),