fix some handling

This commit is contained in:
2026-07-08 11:09:11 +03:30
parent a04dc6e57d
commit 130fadc193
4 changed files with 244 additions and 24 deletions
+80
View File
@@ -0,0 +1,80 @@
-- تنظیمات متن راهنمای واریز و پیام پشتیبانی (placeholder مثل invite_link_text)
-- اجرا روی DB موجود
START TRANSACTION;
SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;
SET @deposit_guide_desc = 'متن راهنمای واریز در مودال شارژ حساب. متغیرها: ٪نام یا %نام = نام صاحب حساب؛ ٪کارت یا %کارت = شماره کارت؛ ٪شبا یا %شبا = شبا. فاصله بعد از ٪ اختیاری است. اگر خالی باشد از متن پیش‌فرض اپ استفاده می‌شود.';
SET @deposit_support_msg_desc = 'متن پیام هنگام کلیک روی «پیام به پشتیبانی» و «پیام به پشتیبانی (sms)» در مودال واریز. همان متغیرهای ٪نام، ٪کارت و ٪شبا. پیش‌فرض: «شماره حساب».';
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'deposit_account_holder', '', 'نام صاحب حساب واریز', 1, 1,
'نام صاحب حساب واریز — در متن راهنما و پیام پشتیبانی با ٪نام یا %نام جایگزین می‌شود.', 'text'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'deposit_account_holder' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'deposit_card_number', '', 'شماره کارت واریز', 1, 1,
'شماره کارت واریز — در متن‌ها با ٪کارت یا %کارت جایگزین می‌شود.', 'text'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'deposit_card_number' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'deposit_sheba', '', 'شبا واریز', 1, 1,
'شماره شبا واریز — در متن‌ها با ٪شبا یا %شبا جایگزین می‌شود.', 'text'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'deposit_sheba' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'deposit_support_message_text', 'شماره حساب', 'متن پیام به پشتیبانی (واریز)', 1, 1, @deposit_support_msg_desc, 'longtext'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'deposit_support_message_text' LIMIT 1);
UPDATE `settings` SET
`title_fa` = 'نام صاحب حساب واریز',
`type` = 'text',
`can_edit` = 1,
`is_active` = 1,
`description` = 'نام صاحب حساب واریز — در متن راهنما و پیام پشتیبانی با ٪نام یا %نام جایگزین می‌شود.'
WHERE `key` = 'deposit_account_holder';
UPDATE `settings` SET
`title_fa` = 'شماره کارت واریز',
`type` = 'text',
`can_edit` = 1,
`is_active` = 1,
`description` = 'شماره کارت واریز — در متن‌ها با ٪کارت یا %کارت جایگزین می‌شود.'
WHERE `key` = 'deposit_card_number';
UPDATE `settings` SET
`title_fa` = 'شبا واریز',
`type` = 'text',
`can_edit` = 1,
`is_active` = 1,
`description` = 'شماره شبا واریز — در متن‌ها با ٪شبا یا %شبا جایگزین می‌شود.'
WHERE `key` = 'deposit_sheba';
UPDATE `settings` SET
`title_fa` = 'متن پیام به پشتیبانی (واریز)',
`type` = 'longtext',
`can_edit` = 1,
`is_active` = 1,
`description` = @deposit_support_msg_desc
WHERE `key` = 'deposit_support_message_text';
UPDATE `settings` SET
`title_fa` = 'متن راهنمای واریز',
`type` = 'longtext',
`can_edit` = 1,
`description` = @deposit_guide_desc
WHERE `key` = 'support_messenger_text';
COMMIT;
SELECT `key`, `title_fa`, `type`, `can_edit`, LEFT(`value`, 60) AS value_preview
FROM `settings`
WHERE `key` IN (
'support_messenger_text',
'deposit_support_message_text',
'deposit_account_holder',
'deposit_card_number',
'deposit_sheba'
)
ORDER BY `key`;