refactor: 调整订单表

This commit is contained in:
2026-08-10 23:46:31 +08:00
parent f0a08444c5
commit 58671f3bd6
70 changed files with 1163 additions and 2132 deletions
@@ -25,7 +25,9 @@ CREATE TABLE `ec_order` (
`platform_order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '平台订单号',
`source` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'import' COMMENT '来源:import-导入 sync-平台镜像转换 manual-手工',
`source_order_id` bigint UNSIGNED NULL DEFAULT NULL COMMENT '来源平台镜像订单主键(如 channel_pdd_order.id;无跨表 FK,结合 platform 解析)',
`pay_amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '实付/商家实收金额(订单合计)',
`pay_amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '买家实付金额(订单合计)',
`received_amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '商家实收金额(=实付-服务费+平台优惠)',
`service_fee` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '平台服务费(多平台归一;PDD 来自 service_fee_detail 汇总)',
`goods_amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '商品金额合计',
`discount_amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '折扣金额合计',
`postage` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '邮费',