new check for kashkol
This commit is contained in:
@@ -93,10 +93,6 @@ INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `de
|
||||
SELECT 'chart_id', '', 'UUID نمودار Zaarbox', 1, 1, 'خالی = ca3800a0-1f57-3528-b963-178f9168e04f'
|
||||
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`)
|
||||
SELECT 'etehadie_api_url', 'https://price.zaarbox.ir/api/free', 'آدرس API اتحادیه (پشتیبان)', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'etehadie_api_url' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'show_last_price', 'true', 'نمایش آخرین قیمت DB اگر API قطع شد', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'show_last_price' LIMIT 1);
|
||||
@@ -105,10 +101,6 @@ INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `de
|
||||
SELECT 'main_product_price', 'false', 'قیمت از محصول (legacy)', 1, 1, 'از price_provider استفاده کنید'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'main_product_price' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'tabanGohar_price', 'false', 'قیمت تابان گوهر', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'tabanGohar_price' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_price', 'false', 'قیمت از همکار (montzar)', 1, 1, 'معمولاً false وقتی price_provider=zaarbox'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_price' LIMIT 1);
|
||||
@@ -325,7 +317,7 @@ WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_gateway_item'
|
||||
-- =============================================================================
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'منبع قیمت'), `can_edit` = 1,
|
||||
`description` = 'zaarbox | main_product | montzar | etehadie | taban_gohar'
|
||||
`description` = 'منبع فعال قیمت|montzar,zaarbox,main_product'
|
||||
WHERE `key` = 'price_provider';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'محصول / UUID تابلو'), `can_edit` = 1
|
||||
@@ -419,7 +411,7 @@ WHERE `key` = 'main_product';
|
||||
UPDATE `settings` SET `type` = 'longtext' WHERE `key` IN ('text_rule', 'text_about');
|
||||
|
||||
-- select (+ گزینهها در description)
|
||||
UPDATE `settings` SET `type` = 'select', `description` = 'montzar,zaarbox,main_product,etehadie,taban_gohar' WHERE `key` = 'price_provider';
|
||||
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` = 'select', `description` = 'sepal,' WHERE `key` = 'payping_gateway_name';
|
||||
UPDATE `settings` SET `type` = 'select', `description` = 'bale,telegram,whatsapp,rubika,eitaa,soroush' WHERE `key` = 'support_messenger';
|
||||
@@ -427,7 +419,7 @@ UPDATE `settings` SET `type` = 'select', `description` = 'bale,telegram,whatsapp
|
||||
-- switch
|
||||
UPDATE `settings` SET `type` = 'switch' WHERE `key` IN (
|
||||
'jibit_verification', 'register_jibit_verify', 'open_register', 'auto_active_customer',
|
||||
'close_price', 'montzar_price', 'main_product_price', 'tabanGohar_price', 'show_last_price',
|
||||
'close_price', 'montzar_price', 'main_product_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',
|
||||
@@ -469,7 +461,7 @@ UPDATE `settings` SET `type` = 'text' WHERE `type` IS NULL OR TRIM(`type`) = '';
|
||||
-- کلیدهای modular اضافی (INSERT اگر نبود)
|
||||
-- ---------------------------------------------------------------------------
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`, `description`)
|
||||
SELECT 'price_provider', 'منبع قیمت', 'montzar', 1, 0, 1, 'select', 'منبع فعال قیمت|montzar,zaarbox,main_product,taban_gohar,etehadie'
|
||||
SELECT 'price_provider', 'منبع قیمت', 'montzar', 1, 0, 1, 'select', 'منبع فعال قیمت|montzar,zaarbox,main_product'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'price_provider' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`)
|
||||
@@ -551,7 +543,8 @@ WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'liman' LIMIT 1);
|
||||
DELETE FROM `settings` WHERE `key` IN (
|
||||
'test', 'test2', 'test22', 'test3', 'test33', 'longtest', 'longtest2',
|
||||
'is_requaire_referral', 'send_to_goldir', 'goldir_price', 'liman_token',
|
||||
'melted_product_id', 'display_montzar'
|
||||
'melted_product_id', 'display_montzar', 'tabanGohar_price', 'etehadie_api_url',
|
||||
'price_method', 'price_primary_source'
|
||||
);
|
||||
|
||||
DELETE FROM `const` WHERE `key` = 'log' OR `key` LIKE 'goldir%';
|
||||
@@ -563,9 +556,12 @@ UPDATE `settings` SET `description` = NULL
|
||||
WHERE LOWER(TRIM(COALESCE(`description`, ''))) IN ('true', 'false', '0', '1', 'yes', 'no', 'in server')
|
||||
OR TRIM(COALESCE(`description`, '')) LIKE 'count of%';
|
||||
|
||||
UPDATE `settings` SET `description` = 'منبع فعال قیمت|montzar,zaarbox,main_product,taban_gohar,etehadie'
|
||||
UPDATE `settings` SET `description` = 'منبع فعال قیمت|montzar,zaarbox,main_product'
|
||||
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'
|
||||
WHERE `key` = 'referral_id';
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
-- حذف تابانگوهر و منابع قیمت legacy — برای همه پروژهها (ابشده خانگی، گلد علی، قطره، کشکول)
|
||||
-- قبل از اجرا: بکاپ DB
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
DELETE FROM `settings` WHERE `key` IN (
|
||||
'tabanGohar_price',
|
||||
'etehadie_api_url',
|
||||
'price_method',
|
||||
'price_primary_source'
|
||||
);
|
||||
|
||||
UPDATE `settings`
|
||||
SET
|
||||
`value` = CASE
|
||||
WHEN LOWER(TRIM(`value`)) IN ('taban_gohar', 'etehadie') THEN 'montzar'
|
||||
ELSE `value`
|
||||
END,
|
||||
`description` = 'منبع فعال قیمت|montzar,zaarbox,main_product',
|
||||
`type` = 'select'
|
||||
WHERE `key` = 'price_provider';
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user