1. add lottery
This commit is contained in:
2026-02-15 00:05:34 +08:00
parent 9a086b86cd
commit 88a0a5616b
3 changed files with 25 additions and 70 deletions

View File

@@ -3,7 +3,7 @@ CREATE TABLE user_notice
(
id int8 NOT NULL PRIMARY KEY, -- 主键
user_id int8 DEFAULT 0 NOT NULL, -- 用户id
notice_type int4 DEFAULT 0 NOT NULL, -- 通知类型 0-系统通知 1-app通知 2-market通知
notice_type int4 DEFAULT 0 NOT NULL, -- 通知类型 0-全局通知 1-APP系统通知 2-Market系统通知 3-APP用户通知 4-Market用户通知
module_type varchar(256) NULL, -- 业务模块
has_read int4 DEFAULT 0 NOT NULL, -- 是否已读 0-否 1-是
title VARCHAR(100) NULL, -- 标题
@@ -21,7 +21,7 @@ CREATE TABLE user_notice
COMMENT ON TABLE user_notice IS '用户通知';
COMMENT ON COLUMN user_notice.id IS '主键';
COMMENT ON COLUMN user_notice.user_id IS '用户id';
COMMENT ON COLUMN user_notice.notice_type IS '通知类型 0-系统通知 1-app通知 2-market通知';
COMMENT ON COLUMN user_notice.notice_type IS '通知类型 0-全局通知 1-APP系统通知 2-Market系统通知 3-APP用户通知 4-Market用户通知';
COMMENT ON COLUMN user_notice.module_type IS '业务模块类型';
COMMENT ON COLUMN user_notice.has_read IS '是否已读 0-否 1-是';
COMMENT ON COLUMN user_notice.title IS '标题';
@@ -93,8 +93,6 @@ create table benefit_point
status int4 default 1,
is_deleted int4 default 0
);
comment on table benefit_point is '用户福利值表';
comment on column benefit_point.id is '主键(用户id)';
comment on column benefit_point.amount is '金额';
@@ -107,9 +105,6 @@ comment on column benefit_point.update_time is '修改时间';
comment on column benefit_point.status is '状态';
comment on column benefit_point.is_deleted is '是否已删除';
alter table benefit_point
owner to yicha1lu;
DROP TABLE IF EXISTS benefit_point_log;
create table benefit_point_log
(
@@ -156,8 +151,6 @@ comment on column benefit_point_log.update_user is '修改人';
comment on column benefit_point_log.update_time is '修改时间';
comment on column benefit_point_log.status is '状态';
comment on column benefit_point_log.is_deleted is '是否已删除';
alter table benefit_point_log
owner to yicha1lu;
--- 现金券 cash_coupon
@@ -189,8 +182,6 @@ comment on column cash_coupon.update_time is '修改时间';
comment on column cash_coupon.status is '状态';
comment on column cash_coupon.is_deleted is '是否已删除';
alter table cash_coupon
owner to yicha1lu;
DROP TABLE IF EXISTS cash_coupon_log;
create table cash_coupon_log
@@ -238,9 +229,6 @@ comment on column cash_coupon_log.update_time is '修改时间';
comment on column cash_coupon_log.status is '状态';
comment on column cash_coupon_log.is_deleted is '是否已删除';
alter table cash_coupon_log
owner to yicha1lu;
--- 用户积分 user_point
DROP TABLE IF EXISTS user_point;
@@ -270,9 +258,6 @@ comment on column user_point.update_user is '修改人';
comment on column user_point.update_time is '修改时间';
comment on column user_point.is_deleted is '是否已删除';
alter table user_point
owner to yicha1lu;
DROP TABLE IF EXISTS user_point_log;
create table user_point_log
(
@@ -319,8 +304,6 @@ comment on column user_point_log.update_time is '修改时间';
comment on column user_point_log.status is '状态';
comment on column user_point_log.is_deleted is '是否已删除';
alter table user_point_log
owner to yicha1lu;
DROP TABLE IF EXISTS user_commission;
create table user_commission
@@ -350,8 +333,6 @@ comment on column user_commission.update_time is '修改时间';
comment on column user_commission.status is '状态';
comment on column user_commission.is_deleted is '是否已删除';
alter table user_commission
owner to yicha1lu;
DROP TABLE IF EXISTS user_commission_log;
create table user_commission_log
@@ -398,8 +379,6 @@ comment on column user_commission_log.is_deleted is '是否已删除';
create index idx_ucl_uid
on user_commission_log (is_complete, user_id, type, statistical_date, create_time DESC);
alter table user_commission_log
owner to yicha1lu;
-- 佣金账户表
DROP TABLE IF EXISTS market_commission_account;
@@ -442,8 +421,6 @@ comment on column market_commission_account.update_time is '修改时间';
comment on column market_commission_account.status is '状态';
comment on column market_commission_account.is_deleted is '是否已删除';
alter table market_commission_account
owner to yicha1lu;
---------------------------------------insert start
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
"remark", "create_user", "create_dept", "create_time", "update_user",
@@ -546,9 +523,6 @@ comment on column market_commission_goods_cost_log.update_time is '修改时间'
comment on column market_commission_goods_cost_log.status is '状态';
comment on column market_commission_goods_cost_log.is_deleted is '是否已删除';
alter table market_commission_goods_cost_log
owner to yicha1lu;
-- 30%购买人获取用户积分佣金流水表
DROP TABLE IF EXISTS market_commission_user_point_log;
create table market_commission_user_point_log
@@ -602,8 +576,6 @@ comment on column market_commission_user_point_log.update_time is '修改时间'
comment on column market_commission_user_point_log.status is '状态';
comment on column market_commission_user_point_log.is_deleted is '是否已删除';
alter table market_commission_user_point_log
owner to yicha1lu;
-- 10%直推人佣金流水表
DROP TABLE IF EXISTS market_commission_direct_push_log;
@@ -658,8 +630,6 @@ comment on column market_commission_direct_push_log.update_time is '修改时间
comment on column market_commission_direct_push_log.status is '状态';
comment on column market_commission_direct_push_log.is_deleted is '是否已删除';
alter table market_commission_direct_push_log
owner to yicha1lu;
-- 5%运营佣金流水表
DROP TABLE IF EXISTS market_commission_operation_log;
@@ -712,8 +682,6 @@ comment on column market_commission_operation_log.update_time is '修改时间';
comment on column market_commission_operation_log.status is '状态';
comment on column market_commission_operation_log.is_deleted is '是否已删除';
alter table market_commission_operation_log
owner to yicha1lu;
-- 5%广告补贴佣金流水表
DROP TABLE IF EXISTS market_commission_advertising_log;
@@ -762,8 +730,6 @@ comment on column market_commission_advertising_log.update_time is '修改时间
comment on column market_commission_advertising_log.status is '状态';
comment on column market_commission_advertising_log.is_deleted is '是否已删除';
alter table market_commission_advertising_log
owner to yicha1lu;
-- 5%服务商佣金流水表
DROP TABLE IF EXISTS market_commission_service_provider_log;
@@ -826,8 +792,6 @@ comment on column market_commission_service_provider_log.update_time is '修改
comment on column market_commission_service_provider_log.status is '状态';
comment on column market_commission_service_provider_log.is_deleted is '是否已删除';
alter table market_commission_service_provider_log
owner to yicha1lu;
-- 15%极差代理佣金流水表
DROP TABLE IF EXISTS market_commission_agency_log;
@@ -881,9 +845,6 @@ comment on column market_commission_agency_log.update_time is '修改时间';
comment on column market_commission_agency_log.status is '状态';
comment on column market_commission_agency_log.is_deleted is '是否已删除';
alter table market_commission_agency_log
owner to yicha1lu;
-- 5%联创佣金流水表
DROP TABLE IF EXISTS market_commission_co_creator_log;
create table market_commission_co_creator_log
@@ -931,9 +892,6 @@ comment on column market_commission_co_creator_log.update_time is '修改时间'
comment on column market_commission_co_creator_log.status is '状态';
comment on column market_commission_co_creator_log.is_deleted is '是否已删除';
alter table market_commission_co_creator_log
owner to yicha1lu;
DROP TABLE IF EXISTS user_market_package_daily_settlement;
create table user_market_package_daily_settlement --用户福利包每天结算记录
@@ -974,9 +932,6 @@ comment on column user_market_package_daily_settlement.update_time is '修改时
comment on column user_market_package_daily_settlement.status is '状态';
comment on column user_market_package_daily_settlement.is_deleted is '是否已删除';
alter table user_market_package_daily_settlement
owner to yicha1lu;
DROP TABLE IF EXISTS common_lottery_prize;
@@ -1016,16 +971,26 @@ comment on column common_lottery_prize.update_user is '修改人';
comment on column common_lottery_prize.update_time is '修改时间';
comment on column common_lottery_prize.status is '状态:0=下架 1=上架';
comment on column common_lottery_prize.is_deleted is '是否已删除';
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2022583456075808770', '1123598815738675201', 'lotteryPrize', '奖品配置表', 'menu', '/common/lotteryPrize', NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2022583456075808771', '2022583456075808770', 'lotteryPrize_add', '新增', 'add', '/common/lotteryPrize/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2022583456075808772', '2022583456075808770', 'lotteryPrize_edit', '修改', 'edit', '/common/lotteryPrize/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2022583456075808773', '2022583456075808770', 'lotteryPrize_delete', '删除', 'delete', '/api/blade-lotteryprize/lotteryPrize/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2022583456075808774', '2022583456075808770', 'lotteryPrize_view', '查看', 'view', '/common/lotteryPrize/view', 'file-text', 4, 2, 2, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
is_deleted)
VALUES ('2022583456075808770', '1123598815738675201', 'lotteryPrize', '奖品配置表', 'menu', '/common/lotteryPrize',
NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
is_deleted)
VALUES ('2022583456075808771', '2022583456075808770', 'lotteryPrize_add', '新增', 'add', '/common/lotteryPrize/add',
'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
is_deleted)
VALUES ('2022583456075808772', '2022583456075808770', 'lotteryPrize_edit', '修改', 'edit', '/common/lotteryPrize/edit',
'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
is_deleted)
VALUES ('2022583456075808773', '2022583456075808770', 'lotteryPrize_delete', '删除', 'delete',
'/api/blade-lotteryprize/lotteryPrize/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
is_deleted)
VALUES ('2022583456075808774', '2022583456075808770', 'lotteryPrize_view', '查看', 'view', '/common/lotteryPrize/view',
'file-text', 4, 2, 2, 1, NULL, 0);
DROP TABLE IF EXISTS common_lottery_record;
@@ -1057,16 +1022,4 @@ comment on column common_lottery_record.update_user is '修改人';
comment on column common_lottery_record.update_time is '修改时间';
comment on column common_lottery_record.status is '0=未发放 1=已发放 2=发放失败';
comment on column common_lottery_record.is_deleted is '是否已删除';
create index idx_clr_uc on common_lottery_record (user_id, is_deleted, create_time desc);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2022588119768522753', '1123598815738675201', 'lotteryRecord', '抽奖记录表', 'menu', '/common/lotteryRecord', NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2022588119768522754', '2022588119768522753', 'lotteryRecord_add', '新增', 'add', '/common/lotteryRecord/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2022588119768522755', '2022588119768522753', 'lotteryRecord_edit', '修改', 'edit', '/common/lotteryRecord/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2022588119768522756', '2022588119768522753', 'lotteryRecord_delete', '删除', 'delete', '/api/blade-lotteryprize/lotteryRecord/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2022588119768522757', '2022588119768522753', 'lotteryRecord_view', '查看', 'view', '/common/lotteryRecord/view', 'file-text', 4, 2, 2, 1, NULL, 0);
create index idx_clr_duc on common_lottery_record (is_deleted, user_id, create_time desc);