mirror of
https://github.com/certd/certd.git
synced 2026-06-28 22:47:35 +08:00
chore: 佣金等级功能
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
ALTER TABLE cd_invite_commission_log ADD COLUMN level_id bigint NOT NULL DEFAULT 0;
|
||||
ALTER TABLE cd_invite_commission_log ADD COLUMN commission_rate bigint NOT NULL DEFAULT 0;
|
||||
|
||||
CREATE TABLE `cd_invite_level`
|
||||
(
|
||||
`id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`name` varchar(100),
|
||||
`sort` bigint NOT NULL DEFAULT 0,
|
||||
`min_amount` bigint NOT NULL DEFAULT 0,
|
||||
`commission_rate` bigint NOT NULL DEFAULT 0,
|
||||
`is_hidden` boolean NOT NULL DEFAULT false,
|
||||
`disabled` boolean NOT NULL DEFAULT false,
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
CREATE INDEX `index_invite_level_sort` ON `cd_invite_level` (`sort`);
|
||||
|
||||
CREATE TABLE `cd_invite_user_plan`
|
||||
(
|
||||
`id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`user_id` bigint,
|
||||
`enabled` boolean NOT NULL DEFAULT false,
|
||||
`level_id` bigint NOT NULL DEFAULT 0,
|
||||
`level_locked` boolean NOT NULL DEFAULT false,
|
||||
`agreement_time` bigint NOT NULL DEFAULT 0,
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
CREATE UNIQUE INDEX `index_invite_user_plan_user_id` ON `cd_invite_user_plan` (`user_id`);
|
||||
|
||||
INSERT INTO `cd_invite_level` (`name`, `sort`, `min_amount`, `commission_rate`, `is_hidden`, `disabled`)
|
||||
VALUES ('青铜', 10, 0, 10, false, false),
|
||||
('白银', 20, 100000, 15, false, false),
|
||||
('黄金', 30, 500000, 20, false, false),
|
||||
('钻石', 40, 1000000, 30, false, false);
|
||||
@@ -0,0 +1,35 @@
|
||||
ALTER TABLE cd_invite_commission_log ADD COLUMN level_id bigint NOT NULL DEFAULT 0;
|
||||
ALTER TABLE cd_invite_commission_log ADD COLUMN commission_rate bigint NOT NULL DEFAULT 0;
|
||||
|
||||
CREATE TABLE "cd_invite_level"
|
||||
(
|
||||
"id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL,
|
||||
"name" varchar(100),
|
||||
"sort" bigint NOT NULL DEFAULT 0,
|
||||
"min_amount" bigint NOT NULL DEFAULT 0,
|
||||
"commission_rate" bigint NOT NULL DEFAULT 0,
|
||||
"is_hidden" boolean NOT NULL DEFAULT (false),
|
||||
"disabled" boolean NOT NULL DEFAULT (false),
|
||||
"create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
CREATE INDEX "index_invite_level_sort" ON "cd_invite_level" ("sort");
|
||||
|
||||
CREATE TABLE "cd_invite_user_plan"
|
||||
(
|
||||
"id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL,
|
||||
"user_id" bigint,
|
||||
"enabled" boolean NOT NULL DEFAULT (false),
|
||||
"level_id" bigint NOT NULL DEFAULT 0,
|
||||
"level_locked" boolean NOT NULL DEFAULT (false),
|
||||
"agreement_time" bigint NOT NULL DEFAULT 0,
|
||||
"create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
CREATE UNIQUE INDEX "index_invite_user_plan_user_id" ON "cd_invite_user_plan" ("user_id");
|
||||
|
||||
INSERT INTO "cd_invite_level" ("name", "sort", "min_amount", "commission_rate", "is_hidden", "disabled")
|
||||
VALUES ('青铜', 10, 0, 10, false, false),
|
||||
('白银', 20, 100000, 15, false, false),
|
||||
('黄金', 30, 500000, 20, false, false),
|
||||
('钻石', 40, 1000000, 30, false, false);
|
||||
@@ -0,0 +1,35 @@
|
||||
ALTER TABLE cd_invite_commission_log ADD COLUMN level_id integer NOT NULL DEFAULT 0;
|
||||
ALTER TABLE cd_invite_commission_log ADD COLUMN commission_rate integer NOT NULL DEFAULT 0;
|
||||
|
||||
CREATE TABLE "cd_invite_level"
|
||||
(
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
"name" varchar(100),
|
||||
"sort" integer NOT NULL DEFAULT 0,
|
||||
"min_amount" integer NOT NULL DEFAULT 0,
|
||||
"commission_rate" integer NOT NULL DEFAULT 0,
|
||||
"is_hidden" boolean NOT NULL DEFAULT (false),
|
||||
"disabled" boolean NOT NULL DEFAULT (false),
|
||||
"create_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
CREATE INDEX "index_invite_level_sort" ON "cd_invite_level" ("sort");
|
||||
|
||||
CREATE TABLE "cd_invite_user_plan"
|
||||
(
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
"user_id" integer,
|
||||
"enabled" boolean NOT NULL DEFAULT (false),
|
||||
"level_id" integer NOT NULL DEFAULT 0,
|
||||
"level_locked" boolean NOT NULL DEFAULT (false),
|
||||
"agreement_time" integer NOT NULL DEFAULT 0,
|
||||
"create_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
CREATE UNIQUE INDEX "index_invite_user_plan_user_id" ON "cd_invite_user_plan" ("user_id");
|
||||
|
||||
INSERT INTO "cd_invite_level" ("name", "sort", "min_amount", "commission_rate", "is_hidden", "disabled")
|
||||
VALUES ('青铜', 10, 0, 10, false, false),
|
||||
('白银', 20, 100000, 15, false, false),
|
||||
('黄金', 30, 500000, 20, false, false),
|
||||
('钻石', 40, 1000000, 30, false, false);
|
||||
@@ -124,7 +124,9 @@ export class MainConfiguration {
|
||||
|
||||
this.app.getMiddleware().insertFirst(async (ctx: IMidwayKoaContext, next: NextFunction) => {
|
||||
await next();
|
||||
if (shouldSetDefaultNoCache(ctx.path, ctx.response.get('Cache-Control'))) {
|
||||
const path = ctx.path;
|
||||
// 如果是首页则强制设置为不缓存
|
||||
if (path === '/' || path === '/index.html' || shouldSetDefaultNoCache(path, ctx.response.get('Cache-Control')) ) {
|
||||
ctx.response.set('Cache-Control', 'public,max-age=0');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user