13 lines
836 B
SQL
13 lines
836 B
SQL
-- 在钱包业务库执行;尚未建表时,先执行 20261109_add_mch_scene.sql。
|
|
-- 酒店抽成按每单完成的酒店订单配置固定金额,单位元,保留两位小数。
|
|
-- 旧配置默认获得 0.00 元;重复执行会跳过已有字段。
|
|
SET @mch_scene_amount_ddl = IF(
|
|
(SELECT COUNT(*) FROM information_schema.columns
|
|
WHERE table_schema = DATABASE() AND table_name = 'mch_scene'
|
|
AND column_name = 'commission_amount') = 0,
|
|
'ALTER TABLE `mch_scene` ADD COLUMN `commission_amount` DECIMAL(10,2) NOT NULL DEFAULT 0.00 COMMENT ''每单完成酒店订单的固定抽成金额,单位元'' AFTER `enabled`',
|
|
'SELECT ''commission_amount 已存在'' AS message');
|
|
PREPARE mch_scene_amount_stmt FROM @mch_scene_amount_ddl;
|
|
EXECUTE mch_scene_amount_stmt;
|
|
DEALLOCATE PREPARE mch_scene_amount_stmt;
|