数据库
CREATE TABLE `log` (
`id` int(11) unsigned NOT NULL DEFAULT '0',
`event_type` int(11) NOT NULL DEFAULT '1' COMMENT '行为类型: 1:浏览页面 2:点击',
`uuid` varchar(64) NOT NULL DEFAULT '' COMMENT '访客标识',
`page` varchar(32) NOT NULL DEFAULT '' COMMENT '访问页面类型ID',
`client_type` int(11) NOT NULL DEFAULT '0' COMMENT '访问客户端类型, 1:PC 2:移动',
`client_os` int(11) NOT NULL DEFAULT '0' COMMENT '访客操作系统类型ID',
`client_browser` int(11) NOT NULL DEFAULT '0' COMMENT '访客浏览器类型ID',
`client_ip` varchar(64) NOT NULL DEFAULT '' COMMENT '访客IP',
`client_country` varchar(128) NOT NULL DEFAULT '' COMMENT '访客IP所属国家',
`client_province` varchar(32) NOT NULL DEFAULT '' COMMENT '访客IP所属省份',
`client_isp` varchar(32) NOT NULL DEFAULT '' COMMENT '访客IP所属运营商',
`created_mircotime` bigint(20) NOT NULL DEFAULT '0' COMMENT '访问时间微秒',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '访问时间',
`view_num` int(11) DEFAULT NULL,
`path` varchar(300) DEFAULT NULL,
`full_path` varchar(300) DEFAULT NULL,
`first_page` varchar(300) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/c868b1276ccd7a03200ab4f977e35c5e.png)
模拟数据
INSERT INTO `log` (`id`, `event_type`, `uuid`, `page`, `client_type`, `client_os`, `client_browser`, `client_ip`, `client_country`, `client_province`, `client_isp`, `created_mircotime`, `created_at`, `view_num`, `path`, `full_path`, `first_page`)
VALUES
(1, 1, '36f1a12bcf51d888213fde24759187d0', 'docs', 1, 5, 18, '58.215.154.11', '中国', '浙江', '电信', 16340974537518, '2021-10-13 11:57:33', 1, '开始->docs', 'docs,register,vip,docs_info,login,', 'docs'),
(2, 1, '36f1a12bcf51d888213fde24759187d0', 'register', 1, 1, 17, '58.215.154.11', '中国', '浙江', '电信', 16340974537566, '2021-10-13 11:57:33', 2, 'docs->register', 'docs,register,vip,docs_info,login,', 'docs'),
(3, 1, '36f1a12bcf51d888213fde24759187d0', 'vip', 2, 7, 12, '58.215.154.11', '中国', '浙江', '电信', 16340974537602, '2021-10-13 11:57:33', 3, 'register->vip', 'docs,register,vip,docs_info,login,', 'docs'),
(4, 1, '36f1a12bcf51d888213fde24759187d0', 'docs_info', 1, 5, 2, '58.215.154.11', '中国', '浙江', '电信', 16340974537671, '2021-10-13 11:57:33', 4, 'vip->docs_info', 'docs,register,vip,docs_info,login,', 'docs'),
(5, 1, '36f1a12bcf51d888213fde24759187d0', 'login', 2, 2, 5, '58.215.154.11', '中国', '浙江', '电信', 16340974537713, '2021-10-13 11:57:33', 5, 'docs_info->login', 'docs,register,vip,docs_info,login,', 'docs'),
(6, 1, 'b28439abd96a2f19d691691de5a77bde', 'vip', 1, 3, 2, '58.215.154.11', '中国', '浙江', '电信', 16340974537754, '2021-10-13 11:57:33', 1, '开始->vip', 'vip,docs,vip,register,docs,register,', 'vip'),
(7, 1, 'b28439abd96a2f19d691691de5a77bde', 'docs', 2, 4, 17, '58.215.154.11', '中国', '浙江', '电信', 16340974537778, '2021-10-13 11:57:33', 2, 'vip->docs', 'vip,docs,vip,register,docs,register,', 'vip'),
(8, 1, 'b28439abd96a2f19d691691de5a77bde', 'vip', 2, 2, 15, '58.215.154.11', '中国', '浙江', '电信', 16340974537807, '2021-10-13 11:57:33', 3, 'docs->vip', 'vip,docs,vip,register,docs,register,', 'vip'),
(9, 1, 'b28439abd96a2f19d691691de5a77bde', 'register', 1, 9, 1, '58.215.154.11', '中国', '浙江', '电信', 16340974537835, '2021-10-13 11:57:33', 4, 'vip->register', 'vip,docs,vip,register,docs,register,', 'vip'),
(10, 1, 'b28439abd96a2f19d691691de5a77bde', 'docs', 2, 8, 8, '58.215.154.11', '中国', '浙江', '电信', 16340974537858, '2021-10-13 11:57:33', 5, 'register->docs', 'vip,docs,vip,register,docs,register,', 'vip'),
(11, 1, 'b28439abd96a2f19d691691de5a77bde', 'register', 1, 2, 1, '58.215.154.11', '中国', '浙江', '电信', 16340974537895, '2021-10-13 11:57:33', 6, 'docs->register', 'vip,docs,vip,register,docs,register,', 'vip'),
(12, 1, '986af2288aba52b2217999d47815f161', 'index', 1, 1, 16, '58.215.154.11', '中国', '浙江', '电信', 16340974537947, '2021-10-13 11:57:33',