2026-08-24 15:32:35 +03:30
|
|
|
-- menu + show_to_user روی settings (متادیتا؛ value دست نخورده)
|
|
|
|
|
-- از migrate و php artisan settings:deploy اجرا میشود.
|
|
|
|
|
|
|
|
|
|
SET @db = DATABASE();
|
|
|
|
|
|
|
|
|
|
SET @sql = IF(
|
|
|
|
|
(SELECT COUNT(*) FROM information_schema.COLUMNS
|
|
|
|
|
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'settings' AND COLUMN_NAME = 'menu') = 0,
|
|
|
|
|
'ALTER TABLE `settings` ADD COLUMN `menu` VARCHAR(64) NULL DEFAULT NULL',
|
|
|
|
|
'SELECT 1'
|
|
|
|
|
);
|
|
|
|
|
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
|
|
|
|
|
|
|
|
|
SET @sql = IF(
|
|
|
|
|
(SELECT COUNT(*) FROM information_schema.COLUMNS
|
|
|
|
|
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'settings' AND COLUMN_NAME = 'show_to_user') = 0,
|
|
|
|
|
'ALTER TABLE `settings` ADD COLUMN `show_to_user` TINYINT(1) NOT NULL DEFAULT 0',
|
|
|
|
|
'SELECT 1'
|
|
|
|
|
);
|
|
|
|
|
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
|
|
|
|
|
|
|
|
|
UPDATE `settings` SET `menu` = CASE
|
|
|
|
|
WHEN `key` IN (
|
|
|
|
|
'close_price', 'startDay', 'endDay', 'show_last_price',
|
|
|
|
|
'show_home_price_when_closed', 'show_gold_ounce_price', 'trading_hours_by_day'
|
|
|
|
|
) THEN 'trading_hours'
|
|
|
|
|
WHEN `key` = 'tracking_systems' THEN 'capture_sites'
|
|
|
|
|
WHEN `key` LIKE 'chat_%' THEN 'support_chat'
|
|
|
|
|
WHEN `key` LIKE 'deposit_method_%'
|
|
|
|
|
OR `key` IN (
|
|
|
|
|
'deposit_account_holder', 'deposit_card_number', 'deposit_account_number',
|
|
|
|
|
'deposit_sheba', 'deposit_bank_name'
|
|
|
|
|
) THEN 'deposit_methods'
|
|
|
|
|
WHEN `key` LIKE 'support_messenger%'
|
|
|
|
|
OR `key` IN ('deposit_sms_support_number', 'deposit_support_message_text') THEN 'support'
|
|
|
|
|
WHEN `key` LIKE 'zarin_%' THEN 'accounting_zarin'
|
|
|
|
|
WHEN `key` LIKE 'tahesab_%' OR `key` = 'send_to_tahesab' THEN 'accounting_tahesab'
|
|
|
|
|
WHEN `key` LIKE 'pargar_%' OR `key` = 'send_to_pargar' THEN 'accounting_pargar'
|
|
|
|
|
WHEN `key` = 'accounting_provider' THEN 'accounting_provider'
|
|
|
|
|
WHEN `key` LIKE 'payping_%' THEN 'payping'
|
|
|
|
|
WHEN `key` LIKE 'external_payment_%' OR `key` = 'wallet_payment_provider' THEN 'deposit_methods'
|
|
|
|
|
WHEN `key` LIKE 'montzar_%' OR `key` = 'display_montzar' THEN 'montzar'
|
|
|
|
|
WHEN `key` LIKE 'sms_notif_%'
|
|
|
|
|
OR `key` IN ('charge_notif', 'register_referral_sms_to_referrer') THEN 'notifications'
|
|
|
|
|
WHEN `key` LIKE 'price_channel_%' OR `key` = 'change_mesghal' THEN 'price_channel'
|
|
|
|
|
WHEN `key` LIKE 'telegram_bot%' OR `key` LIKE 'bale_bot%' OR `key` LIKE 'rubika_bot%' THEN 'bots'
|
|
|
|
|
WHEN `key` LIKE 'referral_%'
|
|
|
|
|
OR `key` IN ('invite_link_text', 'gift_for', 'register_referral', 'referral_bonus_amount') THEN 'referral'
|
2026-08-24 18:17:47 +03:30
|
|
|
WHEN `key` LIKE 'text_%' OR `key` IN ('about_software') THEN 'content'
|
|
|
|
|
WHEN `key` LIKE 'logo_%' OR `key` IN (
|
|
|
|
|
'name_fa', 'name_en', 'app_url', 'admin_url', 'apk_download_link', 'bace_url', 'server_url',
|
|
|
|
|
'title_pwa', 'title_fav', 'metal_type', 'main_metal', 'unit', 'open_register', 'auto_active_customer',
|
|
|
|
|
'store_status', 'key', 'is_store', 'sms_panel', 'enamad_url', 'enamad_logo'
|
|
|
|
|
) THEN 'general'
|
2026-08-24 15:32:35 +03:30
|
|
|
WHEN `key` LIKE 'min_%' OR `key` LIKE 'minimum_%' OR `key` LIKE 'balance_report_exclude%' THEN 'limits'
|
|
|
|
|
WHEN `key` LIKE 'zaarbox_%' OR `key` IN ('price_provider', 'main_product') THEN 'price_source'
|
|
|
|
|
WHEN `key` LIKE 'node_%' OR `key` IN ('montify_name', 'external_order_api_enabled') THEN 'store'
|
|
|
|
|
WHEN `key` LIKE 'chart_%' THEN 'chart'
|
|
|
|
|
WHEN `key` IN ('wss_enabled', 'sse_path', 'wss_path', 'profit_gold_api_enabled') THEN 'infra'
|
|
|
|
|
WHEN `key` LIKE 'fee_%'
|
|
|
|
|
OR `key` IN ('buy_fee', 'sell_fee', 'up_price', 'down_price', 'price_extreme_date')
|
|
|
|
|
OR `key` LIKE '%charge_percentage%' THEN 'fees'
|
|
|
|
|
WHEN `key` LIKE 'product_%'
|
|
|
|
|
OR `key` IN ('main_wallet_products', 'require_zero_main_gold_before_other_buy')
|
|
|
|
|
OR `key` LIKE 'profit_gold%' THEN 'features'
|
|
|
|
|
WHEN `key` IN (
|
|
|
|
|
'banner_enabled', 'tracking_systems_enabled', 'jibit_verification', 'register_jibit_verify',
|
|
|
|
|
'show_product_details', 'show_product_trade_status', 'show_product_card_meta',
|
|
|
|
|
'products_site_link_enabled', 'products_site_link_url', 'products_site_link_text', 'has_chat',
|
|
|
|
|
'enable_conditional_order', 'enable_product_funds', 'has_page_price_trigger', 'has_page_notification',
|
|
|
|
|
'has_page_gift_card', 'enable_customer_level_profit', 'jibit_enabled', 'customer_direct_sms',
|
|
|
|
|
'has_page_earn_money', 'group_sms', 'customer_special_pricing', 'permision__enabled', 'show_to_users_chat'
|
|
|
|
|
) THEN 'customer_features'
|
|
|
|
|
ELSE 'misc'
|
|
|
|
|
END;
|
|
|
|
|
|
|
|
|
|
UPDATE `settings` SET `show_to_user` = 0;
|
|
|
|
|
|
|
|
|
|
UPDATE `settings` SET `show_to_user` = 1 WHERE `key` IN (
|
2026-08-24 17:00:18 +03:30
|
|
|
'about_software',
|
2026-08-24 15:32:35 +03:30
|
|
|
'apk_download_link',
|
|
|
|
|
'app_url',
|
|
|
|
|
'banner_enabled',
|
|
|
|
|
'chat_api',
|
|
|
|
|
'chat_download_url',
|
|
|
|
|
'chat_upload_url',
|
|
|
|
|
'close_price',
|
|
|
|
|
'deposit_account_holder',
|
|
|
|
|
'deposit_account_number',
|
|
|
|
|
'deposit_bank_name',
|
|
|
|
|
'deposit_card_number',
|
|
|
|
|
'deposit_method_card_to_card',
|
|
|
|
|
'deposit_method_gateway',
|
|
|
|
|
'deposit_method_identified',
|
|
|
|
|
'deposit_method_shetab',
|
|
|
|
|
'deposit_sheba',
|
|
|
|
|
'deposit_sms_support_number',
|
|
|
|
|
'deposit_support_message_text',
|
|
|
|
|
'enable_conditional_order',
|
|
|
|
|
'enable_product_funds',
|
2026-08-24 18:17:47 +03:30
|
|
|
'enamad_logo',
|
2026-08-24 17:00:18 +03:30
|
|
|
'enamad_url',
|
2026-08-24 15:32:35 +03:30
|
|
|
'endDay',
|
|
|
|
|
'fee_conditional_order',
|
|
|
|
|
'fee_deduct_from_gold',
|
|
|
|
|
'fee_service_charge_percentage',
|
|
|
|
|
'has_chat',
|
|
|
|
|
'has_page_gift_card',
|
|
|
|
|
'has_page_notification',
|
|
|
|
|
'has_page_price_trigger',
|
|
|
|
|
'invite_link_text',
|
|
|
|
|
'main_product',
|
|
|
|
|
'main_wallet_products',
|
|
|
|
|
'metal_type',
|
|
|
|
|
'min_deposit',
|
|
|
|
|
'min_withdraw',
|
|
|
|
|
'open_register',
|
|
|
|
|
'permision__enabled',
|
|
|
|
|
'products_site_link_enabled',
|
|
|
|
|
'products_site_link_text',
|
|
|
|
|
'products_site_link_url',
|
|
|
|
|
'referral_id',
|
|
|
|
|
'referral_show',
|
|
|
|
|
'show_gold_ounce_price',
|
|
|
|
|
'show_home_price_when_closed',
|
|
|
|
|
'show_product_card_meta',
|
|
|
|
|
'show_product_details',
|
|
|
|
|
'show_product_trade_status',
|
|
|
|
|
'show_to_users_chat',
|
|
|
|
|
'sse_path',
|
|
|
|
|
'startDay',
|
|
|
|
|
'support_messenger',
|
|
|
|
|
'support_messenger_id',
|
|
|
|
|
'support_messenger_text',
|
|
|
|
|
'support_messengers',
|
|
|
|
|
'text_about',
|
|
|
|
|
'text_rule',
|
|
|
|
|
'tracking_systems',
|
|
|
|
|
'tracking_systems_enabled',
|
|
|
|
|
'unit',
|
|
|
|
|
'wss_enabled',
|
|
|
|
|
'wss_path',
|
|
|
|
|
'zaarbox_api_url'
|
|
|
|
|
);
|