fix(settings): read SuperAdmin overlay via ConfigService everywhere

This commit is contained in:
2026-08-22 15:10:54 +03:30
parent 197b49b719
commit 7bdb2c91a0
9 changed files with 31 additions and 35 deletions
+4 -14
View File
@@ -202,15 +202,10 @@ class Controller extends BaseController
])->post('https://tele.ygram.ir/send-message', ["message" => $msg, "chatId" => $to, "botToken" => 'Paramisgold_bot']);
return $response->json();
}
/** @deprecated alias — همان ConfigService::get؛ overlay سوپرادمین را هم می‌خواند */
public static function Config($name)
{
$row = Setting::where('key', $name)->first();
if ($row && $row->is_active && $row->value !== null && $row->value !== '') {
return $row->value;
}
return false;
return app(ConfigService::class)->Config($name);
}
/** دامنهٔ عمومی سایت — فقط از درخواست HTTP فعلی */
@@ -227,12 +222,7 @@ class Controller extends BaseController
protected static function metalTypeSettingValue(): ?string
{
$metalType = Setting::where('key', 'metal_type')->value('value');
if ($metalType === null) {
return null;
}
$metalType = trim((string) $metalType);
$metalType = trim((string) app(ConfigService::class)->getString('metal_type'));
return $metalType !== '' ? $metalType : null;
}
@@ -495,7 +485,7 @@ class Controller extends BaseController
public static function tradeWeightUnit(): string
{
return self::resolveTradeWeightUnit(
Setting::where('key', 'unit')->value('value')
app(ConfigService::class)->getString('unit')
);
}