fixed price 3

This commit is contained in:
2026-06-28 11:03:54 +03:30
parent 9b9685f477
commit 9f92466ada
2 changed files with 11 additions and 17 deletions
@@ -298,7 +298,7 @@ class ReportController extends Controller
json_encode($montzarProduct, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) json_encode($montzarProduct, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)
); );
$montzarFlags = $config->syncMontzarOpenFlagsFromProduct($montzarProduct); $montzarFlags = $config->montzarOpenFlags();
$montzar_open_buy = $montzarFlags['open_buy']; $montzar_open_buy = $montzarFlags['open_buy'];
$montzar_open_sell = $montzarFlags['open_sell']; $montzar_open_sell = $montzarFlags['open_sell'];
@@ -529,7 +529,7 @@ class ReportController extends Controller
json_encode($montzarProduct, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) json_encode($montzarProduct, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)
); );
$montzarFlags = $config->syncMontzarOpenFlagsFromProduct($montzarProduct); $montzarFlags = $config->montzarOpenFlags();
$openBuy = $montzarFlags['open_buy']; $openBuy = $montzarFlags['open_buy'];
$openSell = $montzarFlags['open_sell']; $openSell = $montzarFlags['open_sell'];
+9 -15
View File
@@ -501,22 +501,16 @@ class ConfigService
$this->UpdateConfig('montzar_closed', $staleLive > 0 ? 'false' : 'true'); $this->UpdateConfig('montzar_closed', $staleLive > 0 ? 'false' : 'true');
} }
public function syncMontzarOpenFlagsFromProduct(array $montzarProduct): array /**
* باز/بسته بودن خرید و فروش فقط دست ادمین است — sync همکار آن را بازنویسی نمی‌کند.
* مقدار ذخیره‌شده در تنظیمات همان چیزی است که ادمین روشن/خاموش کرده.
*/
public function montzarOpenFlags(): array
{ {
$openBuy = $this->getBool('montzar_open_buy', true); return [
$openSell = $this->getBool('montzar_open_sell', true); 'open_buy' => $this->getBool('montzar_open_buy', true),
'open_sell' => $this->getBool('montzar_open_sell', true),
if (array_key_exists('open_buy', $montzarProduct)) { ];
$openBuy = filter_var($montzarProduct['open_buy'], FILTER_VALIDATE_BOOLEAN);
$this->UpdateConfig('montzar_open_buy', $openBuy ? 'true' : 'false');
}
if (array_key_exists('open_sell', $montzarProduct)) {
$openSell = filter_var($montzarProduct['open_sell'], FILTER_VALIDATE_BOOLEAN);
$this->UpdateConfig('montzar_open_sell', $openSell ? 'true' : 'false');
}
return ['open_buy' => $openBuy, 'open_sell' => $openSell];
} }
public function formatTradingTimeForDisplay(string $time): string public function formatTradingTimeForDisplay(string $time): string