update: log api

This commit is contained in:
v2board
2023-05-24 01:08:13 +08:00
parent 4dc6d29076
commit 3752bed0d6
8 changed files with 203 additions and 66 deletions

View File

@ -81,6 +81,23 @@ CREATE TABLE `v2_knowledge` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='知識庫';
DROP TABLE IF EXISTS `v2_log`;
CREATE TABLE `v2_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`level` varchar(11) DEFAULT NULL,
`host` varchar(255) DEFAULT NULL,
`uri` varchar(255) NOT NULL,
`method` varchar(11) NOT NULL,
`data` text,
`ip` varchar(128) DEFAULT NULL,
`context` text,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `v2_mail_log`;
CREATE TABLE `v2_mail_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@ -163,8 +180,8 @@ CREATE TABLE `v2_plan` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) NOT NULL,
`transfer_enable` int(11) NOT NULL,
`speed_limit` int(11) DEFAULT NULL,
`name` varchar(255) NOT NULL,
`speed_limit` int(11) DEFAULT NULL,
`show` tinyint(1) NOT NULL DEFAULT '0',
`sort` int(11) DEFAULT NULL,
`renew` tinyint(1) NOT NULL DEFAULT '1',
@ -408,8 +425,8 @@ CREATE TABLE `v2_user` (
`transfer_enable` bigint(20) NOT NULL DEFAULT '0',
`banned` tinyint(1) NOT NULL DEFAULT '0',
`is_admin` tinyint(1) NOT NULL DEFAULT '0',
`is_staff` tinyint(1) NOT NULL DEFAULT '0',
`last_login_at` int(11) DEFAULT NULL,
`is_staff` tinyint(1) NOT NULL DEFAULT '0',
`last_login_ip` int(11) DEFAULT NULL,
`uuid` varchar(36) NOT NULL,
`group_id` int(11) DEFAULT NULL,
@ -418,8 +435,8 @@ CREATE TABLE `v2_user` (
`remind_expire` tinyint(4) DEFAULT '1',
`remind_traffic` tinyint(4) DEFAULT '1',
`token` char(32) NOT NULL,
`remarks` text,
`expired_at` bigint(20) DEFAULT '0',
`remarks` text,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`),
@ -427,4 +444,4 @@ CREATE TABLE `v2_user` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 2023-05-03 07:27:22
-- 2023-05-23 17:01:12

View File

@ -107,17 +107,6 @@ CREATE TABLE `v2_coupon` (
ALTER TABLE `v2_order`
ADD `discount_amount` int(11) NULL AFTER `total_amount`;
CREATE TABLE `v2_tutorial` (
`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
`title` varchar(255) COLLATE 'utf8mb4_general_ci' NOT NULL,
`description` varchar(255) COLLATE 'utf8mb4_general_ci' NOT NULL,
`icon` varchar(255) COLLATE 'utf8mb4_general_ci' NOT NULL,
`steps` text NULL,
`show` tinyint(1) NOT NULL DEFAULT '0',
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL
);
ALTER TABLE `v2_server_log`
CHANGE `rate` `rate` decimal(10,2) NOT NULL AFTER `d`;
@ -375,20 +364,6 @@ ALTER TABLE `v2_stat_server`
ADD INDEX `record_at` (`record_at`),
ADD INDEX `server_id` (`server_id`);
CREATE TABLE `v2_stat_order` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_count` int(11) NOT NULL COMMENT '订单数量',
`order_amount` int(11) NOT NULL COMMENT '订单合计',
`commission_count` int(11) NOT NULL,
`commission_amount` int(11) NOT NULL COMMENT '佣金合计',
`record_type` char(1) NOT NULL,
`record_at` int(11) NOT NULL,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `record_at` (`record_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单统计';
ALTER TABLE `v2_user`
DROP `enable`;
@ -697,3 +672,18 @@ ALTER TABLE `v2_stat_order`
ADD `invite_count` int(11) NOT NULL AFTER `register_count`,
ADD `transfer_used_total` varchar(32) NOT NULL AFTER `invite_count`,
RENAME TO `v2_stat`;
CREATE TABLE `v2_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`level` varchar(11) DEFAULT NULL,
`host` varchar(255) DEFAULT NULL,
`uri` varchar(255) NOT NULL,
`method` varchar(11) NOT NULL,
`data` text,
`ip` varchar(128) DEFAULT NULL,
`context` text,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;