khanegi setting and prices records

This commit is contained in:
2026-06-13 17:35:40 +03:30
parent c70cda0b6b
commit 91a82c06e4
15 changed files with 509 additions and 73 deletions
+63 -15
View File
@@ -89,8 +89,13 @@ WHERE r.`key` = 'referral_id'
-- =============================================================================
-- قیمت zaarbox (اگر از قبل دارید value دست نخورده)
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
SELECT 'chart_id', '', 'UUID نمودار Zaarbox', 1, 1, 'خالی = ca3800a0-1f57-3528-b963-178f9168e04f'
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'chart_use_local_data', 'false', 'نمودار از داده خود سایت', 1, 1,
'خاموش = Zaarbox (chart_id) | روشن = تاریخچه ذخیره‌شده prices', 'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'chart_use_local_data' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'chart_id', '', 'UUID نمودار Zaarbox', 1, 1, 'خالی = ca3800a0-1f57-3528-b963-178f9168e04f', 'text'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'chart_id' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
@@ -451,26 +456,26 @@ UPDATE `settings` SET `type` = 'longtext' WHERE `key` IN ('text_rule', 'text_abo
-- select (+ گزینه‌ها در description)
UPDATE `settings` SET `type` = 'select', `description` = 'منبع فعال قیمت|montzar,zaarbox,main_product' WHERE `key` = 'price_provider';
UPDATE `settings` SET `type` = 'select', `description` = 'required = اجباری؛ خالی = اختیاری|required,', `can_edit` = 1 WHERE `key` = 'referral_id';
UPDATE `settings` SET `type` = 'switch', `title_fa` = 'کد معرف اجباری', `description` = 'روشن = اجباری در ثبت‌نام | خاموش = اختیاری', `can_edit` = 1 WHERE `key` = 'referral_id';
UPDATE `settings` SET `type` = 'select', `description` = 'sepal,' WHERE `key` = 'payping_gateway_name';
UPDATE `settings` SET `type` = 'select', `description` = 'bale,telegram,whatsapp,rubika,eitaa,soroush' WHERE `key` = 'support_messenger';
-- switch
UPDATE `settings` SET `type` = 'switch' WHERE `key` IN (
'chart_use_local_data',
'jibit_verification', 'register_jibit_verify', 'open_register', 'auto_active_customer',
'close_price', 'montzar_price', 'main_product_price', 'show_last_price',
'close_price', 'show_last_price',
'send_to_tahesab', 'profit_gold_api_enabled', 'payping_round_toman', 'payping_strict_failed_withdraw',
'has_page_earn_money', 'has_page_fund', 'has_page_permission', 'has_page_price_trigger',
'has_page_physical_gold', 'has_chat', 'charge_notif', 'group_sms', 'display_montzar',
'has_page_earn_money', 'charge_notif', 'group_sms',
'montzar_closed', 'montzar_open_buy', 'montzar_open_sell',
'product_update_price_on_list', 'product_auto_close_open_on_list', 'payping_fin_sync_enabled',
'fee_free', 'external_order_api_enabled', 'is_store'
'payping_fin_sync_enabled', 'external_order_api_enabled', 'is_store',
'register_referral_sms_to_referrer', 'register_referral_bonus_message', 'price_from_nasiryan'
);
-- number
UPDATE `settings` SET `type` = 'number' WHERE `key` IN (
'fee_single', 'buy_fee', 'sell_fee', 'fee_cash', 'fee_service_charge_percentage',
'min_withdraw', 'min_first_buy', 'minimum_sell', 'referral_count_for_gift',
'fee_single', 'buy_fee', 'sell_fee', 'fee_cash', 'fee_service_charge_percentage', 'fee_free',
'min_withdraw', 'min_first_buy', 'minimum_sell',
'montzar_product_id', 'balance_report_exclude_customer_id', 'gift_for_referrer',
'gift_for_referral', 'up_price', 'down_price', 'payping_fin_customer_id'
);
@@ -580,10 +585,16 @@ WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'liman' LIMIT 1);
-- پاکسازی کلیدهای legacy / تست
-- ---------------------------------------------------------------------------
DELETE FROM `settings` WHERE `key` IN (
'test', 'test2', 'test22', 'test3', 'test33', 'longtest', 'longtest2',
'test', 'test2', 'test22', 'test3', 'test33', 'longtest', 'longtest2', 'test*',
'is_requaire_referral', 'send_to_goldir', 'goldir_price', 'liman_token',
'melted_product_id', 'display_montzar', 'tabanGohar_price', 'etehadie_api_url',
'price_method', 'price_primary_source'
'price_method', 'price_primary_source', 'main_product_price', 'montzar_price',
'has_page_fund', 'has_page_permission', 'has_page_price_trigger', 'has_page_physical_gold',
'has_chat', 'product_update_price_on_list', 'product_auto_close_open_on_list',
'referral_count_for_gift', 'store_status',
'name_en', 'bace_url', 'server_url', 'key', 'color_primary', 'color_secondary',
'logo_register', 'logo_login', 'title_pwa', 'title_fav', 'text_rule', 'text_about',
'payping_gateway_item'
);
DELETE FROM `const` WHERE `key` = 'log' OR `key` LIKE 'goldir%';
@@ -601,11 +612,48 @@ WHERE `key` = 'price_provider';
UPDATE `settings` SET `value` = 'montzar'
WHERE `key` = 'price_provider' AND LOWER(TRIM(`value`)) IN ('taban_gohar', 'etehadie');
UPDATE `settings` SET `description` = 'required = اجباری|required,', `title_fa` = 'کد معرف', `type` = 'select'
UPDATE `settings` SET
`type` = 'switch',
`title_fa` = 'کد معرف اجباری',
`description` = 'روشن = اجباری در ثبت‌نام | خاموش = اختیاری',
`can_edit` = 1,
`is_active` = 1
WHERE `key` = 'referral_id';
UPDATE `settings` SET `description` = 'جایگزین: price_provider=main_product' WHERE `key` = 'main_product_price';
UPDATE `settings` SET `description` = 'true یا price_provider=montzar' WHERE `key` = 'montzar_price';
UPDATE `settings` SET `value` = 'required'
WHERE `key` = 'referral_id'
AND LOWER(TRIM(COALESCE(`value`, ''))) IN ('required', 'true', '1', 'yes');
UPDATE `settings` SET `value` = ''
WHERE `key` = 'referral_id'
AND LOWER(TRIM(COALESCE(`value`, ''))) NOT IN ('required');
UPDATE `settings` SET `type` = 'switch', `value` = 'false', `is_active` = 1, `can_edit` = 1
WHERE `key` IN ('register_referral_sms_to_referrer', 'register_referral_bonus_message')
AND (`type` IS NULL OR TRIM(`type`) = '' OR `type` = 'text')
AND TRIM(COALESCE(`value`, '')) = '';
UPDATE `settings` SET `type` = 'switch', `is_active` = 1
WHERE `key` IN ('register_referral_sms_to_referrer', 'register_referral_bonus_message');
UPDATE `settings` SET `value` = 'false'
WHERE `key` IN ('register_referral_sms_to_referrer', 'register_referral_bonus_message')
AND TRIM(COALESCE(`value`, '')) = '';
UPDATE `settings` SET
`type` = 'switch',
`title_fa` = 'نمودار از داده خود سایت',
`description` = 'خاموش = Zaarbox (chart_id) | روشن = تاریخچه prices',
`is_active` = 1,
`can_edit` = 1
WHERE `key` = 'chart_use_local_data';
UPDATE `settings` SET `type` = 'number', `title_fa` = 'تعداد سفارش اول بدون کارمزد', `description` = 'عدد — ۰ یعنی غیرفعال'
WHERE `key` = 'fee_free';
-- همه تنظیمات قابل ویرایش همیشه فعال
UPDATE `settings` SET `is_active` = 1 WHERE `can_edit` = 1 AND (`is_active` IS NULL OR `is_active` = 0);
UPDATE `settings` SET `description` = 'تعداد سفارش اول بدون کارمزد' WHERE `key` = 'fee_free';
UPDATE `settings` SET `description` = 'id یا reading_method محصول آبشده' WHERE `key` = 'main_product';