fix(sms): keep charge deposit defaults and unlock referral bonus
Empty SuperAdmin chargeInfo was wiping sms_charge_* on header refresh. Seed those keys only when empty, and move referral_bonus_amount to can_edit=1. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,7 +29,7 @@ class SmsWalletService
|
||||
/** مقادیر پیشفرض اطلاعات واریز. */
|
||||
public const DEPOSIT_DEFAULTS = [
|
||||
'card_number' => '6219861961033817',
|
||||
'sheba' => 'IR080560611828005603604401',
|
||||
'sheba' => 'IR080560611828005603604201',
|
||||
'account_holder' => 'حسین منتظر',
|
||||
'note' => 'لطفا مبلغ مورد نظر خود جهت شارژ سامانه پیامکی را به شماره کارت یا حساب زیر واریز نمایید و تصویر فیش پرداختی را برای پشتیبانی بفرستید.',
|
||||
];
|
||||
@@ -331,7 +331,14 @@ class SmsWalletService
|
||||
}
|
||||
|
||||
$setting = Setting::firstOrNew(['key' => $key]);
|
||||
$setting->value = (string) ($data[$field] ?? '');
|
||||
$incoming = trim((string) ($data[$field] ?? ''));
|
||||
if ($incoming === '') {
|
||||
if ($setting->exists && trim((string) $setting->value) !== '') {
|
||||
continue;
|
||||
}
|
||||
$incoming = self::DEPOSIT_DEFAULTS[$field];
|
||||
}
|
||||
$setting->value = $incoming;
|
||||
|
||||
if ($setting->title_fa === null || $setting->title_fa === '') {
|
||||
$setting->title_fa = self::depositFieldTitle($field);
|
||||
|
||||
Reference in New Issue
Block a user