增加套餐绑定用户功能

This commit is contained in:
wuweihua
2026-10-19 11:59:44 +08:00
parent 69852907f3
commit 374c8b8bbb
13 changed files with 467 additions and 0 deletions
+17
View File
@@ -802,6 +802,23 @@ CREATE TABLE `prc_customer_price_set` (
CONSTRAINT `fk_customer_price_set` FOREIGN KEY (`price_set_id`) REFERENCES `prc_price_set` (`price_set_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='客户套餐表-客户某时间段内使用的套餐';
-- ----------------------------
-- 表结构:`prc_price_set_user`
-- ----------------------------
CREATE TABLE `prc_price_set_user` (
`psu_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`price_set_id` bigint(20) NOT NULL COMMENT '价格套餐id',
`user_id` bigint(20) NOT NULL COMMENT '用户id',
`user_name` varchar(64) NOT NULL DEFAULT '' COMMENT '登录账号',
`created_by` varchar(64) DEFAULT '' COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`psu_id`),
UNIQUE KEY `uk_psu_set_user` (`price_set_id`,`user_id`),
KEY `idx_psu_user` (`user_id`),
KEY `idx_psu_set` (`price_set_id`),
CONSTRAINT `fk_psu_set` FOREIGN KEY (`price_set_id`) REFERENCES `prc_price_set` (`price_set_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='套餐可见用户绑定';
-- ----------------------------
-- 表结构:`prc_income_bill`
-- ----------------------------
+16
View File
@@ -0,0 +1,16 @@
-- Price set viewer bind
SET NAMES utf8mb4;
CREATE TABLE IF NOT EXISTS prc_price_set_user (
psu_id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
price_set_id bigint(20) NOT NULL COMMENT '价格套餐id',
user_id bigint(20) NOT NULL COMMENT '用户id',
user_name varchar(64) NOT NULL DEFAULT '' COMMENT '登录账号',
created_by varchar(64) DEFAULT '' COMMENT '创建人',
create_time datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (psu_id),
UNIQUE KEY uk_psu_set_user (price_set_id, user_id),
KEY idx_psu_user (user_id),
KEY idx_psu_set (price_set_id),
CONSTRAINT fk_psu_set FOREIGN KEY (price_set_id) REFERENCES prc_price_set (price_set_id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='套餐可见用户绑定';