fix some handling 3

This commit is contained in:
2026-07-08 12:45:14 +03:30
parent 5781d5bf53
commit a4e98d8047
6 changed files with 311 additions and 61 deletions
+42 -3
View File
@@ -42,6 +42,22 @@ SET @invite_link_desc = 'متن پیام اشتراک‌گذاری دعوت در
SET @deposit_guide_desc = 'متن راهنمای واریز در مودال شارژ حساب. متغیرها: ٪نام یا %نام = نام صاحب حساب؛ ٪کارت یا %کارت = شماره کارت؛ ٪شبا یا %شبا = شبا. فاصله بعد از ٪ اختیاری است. اگر خالی باشد از متن پیش‌فرض اپ استفاده می‌شود.';
SET @deposit_support_msg_desc = 'متن پیام هنگام کلیک روی «پیام به پشتیبانی» و «پیام به پشتیبانی (sms)» در مودال واریز. همان متغیرهای ٪نام، ٪کارت و ٪شبا. پیش‌فرض: «شماره حساب».';
SET @price_channel_message_desc = 'قالب متن پیام ارسالی به کانال. متغیرهای قیمت تابلو: ٪گرم_خرید ٪گرم_فروش ٪مثقال_خرید ٪مثقال_فروش (یا با %). زمان: ٪تاریخ ٪ساعت. اپ: ٪اسم_اپ یا ٪نام (نام فارسی)؛ ٪عنوان = خط «📊 قیمت لحظه‌ای + نام». تماس جدا: ٪آیدی ٪شماره ٪لینک. اختیاری: ٪محصولات (لیست همه محصولات)؛ ٪فوتر (ترکیب آیدی+شماره+لینک). فاصله بعد از ٪ اختیاری است. خالی = قالب پیش‌فرض.';
SET @price_channel_default_text = CONCAT(
'سلام 👋', CHAR(10),
'%عنوان', CHAR(10),
'📅 %تاریخ 🕐 %ساعت', CHAR(10),
CHAR(10),
'🔴 خرید گرم: %گرم_خرید', CHAR(10),
'🟢 فروش گرم: %گرم_فروش', CHAR(10),
'🔴 خرید مثقال: %مثقال_خرید', CHAR(10),
'🟢 فروش مثقال: %مثقال_فروش', CHAR(10),
CHAR(10),
'📞 %شماره', CHAR(10),
'%آیدی', CHAR(10),
'%لینک'
);
-- ستون‌های اختیاری settings (بعضی DBهای قدیمی ندارند)
SET @sql = IF(
(SELECT COUNT(*) FROM information_schema.COLUMNS
@@ -379,6 +395,10 @@ SELECT 'price_channel_min_seconds', '120', 'حداقل فاصله ارسال (ث
'حداقل فاصله بین دو ارسال به کانال؛ جلوی سیل پیام را می‌گیرد. صفر = هر تغییر قیمت.', 'number'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'price_channel_min_seconds' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'price_channel_message_text', @price_channel_default_text, 'قالب متن پیام کانال', 1, 1, @price_channel_message_desc, 'longtext'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'price_channel_message_text' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'price_channel_footer_id', '', 'آیدی کانال در پیام', 1, 1,
'اگر پر باشد در انتهای پیام نمایش داده می‌شود (مثلاً یوزرنیم کانال). خالی = نمایش داده نمی‌شود.', 'text'
@@ -706,7 +726,7 @@ WHERE `key` = 'main_product';
-- longtext
UPDATE `settings` SET `type` = 'longtext' WHERE `key` IN (
'text_rule', 'text_about', 'support_messenger_text', 'invite_link_text',
'deposit_support_message_text',
'deposit_support_message_text', 'price_channel_message_text',
'montzar_order_response', 'montzar_last_product_log'
);
@@ -1127,6 +1147,13 @@ UPDATE `settings` SET `description` = 'نوع پیام‌رسان برای دک
UPDATE `settings` SET `description` = 'شناسه تماس پشتیبانی: یوزرنیم (تلگرام)، شماره (واتساپ/بله) یا آیدی بسته به پیام‌رسان انتخاب‌شده.' WHERE `key` = 'support_messenger_id';
UPDATE `settings` SET `description` = @deposit_guide_desc WHERE `key` = 'support_messenger_text';
UPDATE `settings` SET `description` = @deposit_support_msg_desc WHERE `key` = 'deposit_support_message_text';
UPDATE `settings` SET `description` = @price_channel_message_desc WHERE `key` = 'price_channel_message_text';
UPDATE `settings` SET
`title_fa` = 'قالب متن پیام کانال',
`type` = 'longtext',
`can_edit` = 1,
`description` = @price_channel_message_desc
WHERE `key` = 'price_channel_message_text';
UPDATE `settings` SET `description` = 'متن پیام اشتراک‌گذاری دعوت در اپ کاربر (دکمه «اشتراک با دوستان» در صفحه اصلی، بخش معرف در پروفایل، صفحه کسب درآمد و مودال اشتراک). متغیرهای جایگزین: ٪نام یا %نام = نام کامل کاربر دعوت‌کننده؛ ٪لینک یا %لینک = آدرس کامل صفحه ثبت‌نام همراه با کد معرف (بر اساس تنظیم app_url یا دامنه فعلی مرورگر). فاصله اختیاری بعد از ٪ یا % مجاز است (مثلاً ٪ نام). اگر این فیلد خالی باشد، اپ از متن پیش‌فرض داخلی استفاده می‌کند.' WHERE `key` = 'invite_link_text';
UPDATE `settings` SET `description` = 'شماره تماس پشتیبانی؛ در صفحه واریز، درباره ما و قوانین نمایش داده می‌شود. متن پیامک/پشتیبانی از «متن پیام به پشتیبانی (واریز)» خوانده می‌شود.' WHERE `key` = 'deposit_sms_support_number';
@@ -1166,10 +1193,21 @@ UPDATE `settings` SET
`description` = @deposit_support_msg_desc
WHERE `key` = 'deposit_support_message_text';
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'price_channel_message_text', @price_channel_default_text, 'قالب متن پیام کانال', 1, 1, @price_channel_message_desc, 'longtext'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'price_channel_message_text' LIMIT 1);
UPDATE `settings` SET
`title_fa` = 'قالب متن پیام کانال',
`type` = 'longtext',
`can_edit` = 1,
`description` = @price_channel_message_desc
WHERE `key` = 'price_channel_message_text';
UPDATE `settings` SET `type` = 'longtext'
WHERE `key` IN (
'text_rule', 'text_about', 'support_messenger_text', 'invite_link_text',
'deposit_support_message_text',
'deposit_support_message_text', 'price_channel_message_text',
'montzar_order_response', 'montzar_last_product_log'
);
@@ -1360,7 +1398,8 @@ UPDATE `settings` SET `can_edit` = 1 WHERE `key` IN (
'deposit_support_message_text', 'deposit_account_holder', 'deposit_card_number', 'deposit_sheba',
'text_about', 'text_rule',
'price_channel_enabled', 'price_channel_messengers', 'price_channel_diff',
'price_channel_min_seconds', 'price_channel_footer_id', 'price_channel_footer_phone',
'price_channel_min_seconds', 'price_channel_message_text',
'price_channel_footer_id', 'price_channel_footer_phone',
'price_channel_footer_link', 'change_mesghal'
);