客户管理新增区域类型属性

This commit is contained in:
liuminghui
2026-10-30 18:00:20 +08:00
parent bc33e11437
commit d185995dc7
7 changed files with 74 additions and 5 deletions
@@ -0,0 +1,11 @@
-- ctr_customer.area_type:客户区域类型,取值来自字典 data_area_type(可重复执行)
SET @col_exists := (
SELECT COUNT(1) FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'ctr_customer' AND COLUMN_NAME = 'area_type'
);
SET @sql := IF(@col_exists = 0,
'ALTER TABLE `ctr_customer` ADD COLUMN `area_type` varchar(32) DEFAULT NULL COMMENT ''区域类型(字典 data_area_type)'' AFTER `customer_type`',
'SELECT 1');
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;