feat(promotion-fee): 新增推广费类目级归属,区分商品级/类目级/全店比例池

This commit is contained in:
小蟑螂
2026-05-12 13:24:30 +08:00
parent 1621388d9f
commit f5d7fbe2b0
15 changed files with 470 additions and 48 deletions
@@ -0,0 +1,15 @@
-- ================================================
-- ec_promotion_fee:新增 category_id(可空,关联 ec_category)
-- 用于类目级推广费;与 product_id 可同时为空表示店铺级按比例分摊
-- ================================================
ALTER TABLE ec_promotion_fee
ADD COLUMN `category_id` bigint UNSIGNED NULL DEFAULT NULL COMMENT '类目ID(可选,无商品时可用于类目级推广费)' AFTER `shop_id`;
ALTER TABLE ec_promotion_fee
ADD INDEX `idx_category_id`(`category_id` ASC);
ALTER TABLE ec_promotion_fee
ADD CONSTRAINT `fk_ec_promotion_fee_category`
FOREIGN KEY (`category_id`) REFERENCES `ec_category` (`id`)
ON DELETE SET NULL ON UPDATE CASCADE;