增加专属报价功能
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
-- Exclusive quote: share prc_price_set via set_category
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
SET @col_exists := (
|
||||
SELECT COUNT(1) FROM information_schema.columns
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'prc_price_set'
|
||||
AND column_name = 'set_category'
|
||||
);
|
||||
SET @sql := IF(@col_exists = 0,
|
||||
'ALTER TABLE prc_price_set ADD COLUMN set_category varchar(20) NOT NULL DEFAULT ''PACKAGE'' COMMENT ''分类 PACKAGE=普通套餐 EXCLUSIVE=专属报价'' AFTER set_type',
|
||||
'SELECT 1');
|
||||
PREPARE stmt FROM @sql;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
UPDATE prc_price_set
|
||||
SET set_category = 'PACKAGE'
|
||||
WHERE set_category IS NULL OR set_category = '';
|
||||
|
||||
SET @idx_exists := (
|
||||
SELECT COUNT(1) FROM information_schema.statistics
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'prc_price_set'
|
||||
AND index_name = 'idx_ps_category'
|
||||
);
|
||||
SET @sql := IF(@idx_exists = 0,
|
||||
'ALTER TABLE prc_price_set ADD KEY idx_ps_category (set_category)',
|
||||
'SELECT 1');
|
||||
PREPARE stmt FROM @sql;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
Reference in New Issue
Block a user