update: statistics service

This commit is contained in:
v2board
2023-05-03 15:37:19 +08:00
parent 8b3ea1f8ea
commit eee5152f52
15 changed files with 273 additions and 239 deletions

View File

@ -1,4 +1,4 @@
-- Adminer 4.8.1 MySQL 5.7.29 dump
-- Adminer 4.7.7 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
@ -304,19 +304,24 @@ CREATE TABLE `v2_server_vmess` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `v2_stat_order`;
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`)
DROP TABLE IF EXISTS `v2_stat`;
CREATE TABLE `v2_stat` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`record_at` int(11) NOT NULL,
`record_type` char(1) NOT NULL,
`order_count` int(11) NOT NULL COMMENT '订单数量',
`order_total` int(11) NOT NULL COMMENT '订单合计',
`commission_count` int(11) NOT NULL,
`commission_total` int(11) NOT NULL COMMENT '佣金合计',
`paid_count` int(11) NOT NULL,
`paid_total` int(11) NOT NULL,
`register_count` int(11) NOT NULL,
`invite_count` int(11) NOT NULL,
`transfer_used_total` varchar(32) 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='订单统计';
@ -422,4 +427,4 @@ CREATE TABLE `v2_user` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 2023-03-08 06:17:49
-- 2023-05-03 07:27:22

View File

@ -683,3 +683,17 @@ CREATE TABLE `v2_server_hysteria` (
ALTER TABLE `v2_plan`
ADD `capacity_limit` int(11) NULL AFTER `reset_traffic_method`;
ALTER TABLE `v2_stat_order`
CHANGE `record_at` `record_at` int(11) NOT NULL AFTER `id`,
CHANGE `record_type` `record_type` char(1) COLLATE 'utf8_general_ci' NOT NULL AFTER `record_at`,
CHANGE `order_count` `order_count` int(11) NOT NULL COMMENT '订单数量' AFTER `record_type`,
CHANGE `order_amount` `order_total` int(11) NOT NULL COMMENT '订单合计' AFTER `order_count`,
CHANGE `commission_count` `commission_count` int(11) NOT NULL AFTER `order_total`,
CHANGE `commission_amount` `commission_total` int(11) NOT NULL COMMENT '佣金合计' AFTER `commission_count`,
ADD `paid_count` int(11) NOT NULL AFTER `commission_total`,
ADD `paid_total` int(11) NOT NULL AFTER `paid_count`,
ADD `register_count` int(11) NOT NULL AFTER `paid_total`,
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`;