fixed price

This commit is contained in:
2026-06-28 10:51:56 +03:30
parent dec13e8537
commit 14055c5770
4 changed files with 28 additions and 48 deletions
+13 -17
View File
@@ -298,17 +298,13 @@ class ReportController extends Controller
json_encode($montzarProduct, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)
);
$montzar_open_sell = $toBool($montzarProduct['open_sell'] ?? false);
$montzar_open_buy = $toBool($montzarProduct['open_buy'] ?? false);
$montzarFlags = $config->syncMontzarOpenFlagsFromProduct($montzarProduct);
$montzar_open_buy = $montzarFlags['open_buy'];
$montzar_open_sell = $montzarFlags['open_sell'];
$config->UpdateConfig('montzar_open_sell', $montzar_open_sell ? 'true' : 'false');
$config->UpdateConfig('montzar_open_buy', $montzar_open_buy ? 'true' : 'false');
$montzar_price = (int) $customPrice['price'];
if ($montzar_open_sell || $montzar_open_buy) {
$montzar_price = (int) $customPrice['price'];
}
$config->UpdateConfig('montzar_closed', $montzar_price == 0 ? 'true' : 'false');
$config->UpdateConfig('montzar_closed', 'false');
} catch (\Throwable $e) {
$montzar_price = 0;
@@ -533,19 +529,19 @@ class ReportController extends Controller
json_encode($montzarProduct, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)
);
$openBuy = $toBool($montzarProduct['open_buy'] ?? false);
$openSell = $toBool($montzarProduct['open_sell'] ?? false);
$config->UpdateConfig('montzar_open_buy', $openBuy ? 'true' : 'false');
$config->UpdateConfig('montzar_open_sell', $openSell ? 'true' : 'false');
$montzarFlags = $config->syncMontzarOpenFlagsFromProduct($montzarProduct);
$openBuy = $montzarFlags['open_buy'];
$openSell = $montzarFlags['open_sell'];
if ($openBuy || $openSell) {
$montzar = (int) $customPrice['price'];
}
$montzar = (int) $customPrice['price'];
$config->UpdateConfig('montzar_closed', $montzar === 0 ? 'true' : 'false');
$config->UpdateConfig('montzar_closed', 'false');
} catch (\Throwable $e) {
$montzar = 0;
$config->applyMontzarSyncFailure();
if (!$config->getBool('montzar_closed', true)) {
$montzar = $config->getInt('montzar_live_price', 0);
}
\Log::error('STORE MONZAR PRICE ERROR', ['message' => $e->getMessage()]);
}
}