Closed joelin109 closed 6 years ago
DROP TABLE IF EXISTS `stats_lesson_learn_log`;
CREATE TABLE `stats_lesson_learn_log` (
`id` varchar(30) NOT NULL COMMENT '编号',
`user_id` varchar(30) NOT NULL COMMENT '用户ID',
`course_id` varchar(30) NOT NULL COMMENT '课程ID',
`lesson_id` varchar(30) NOT NULL COMMENT '课内容ID',
`media_id` varchar(30) NOT NULL COMMENT 'Media ID',
`duration` int DEFAULT 0 COMMENT '学习时长',
`start_at` varchar(24) DEFAULT NULL COMMENT '开始学习时间',
`end_at` varchar(24) DEFAULT NULL COMMENT '结束学习时间',
`ip` varchar(50) DEFAULT NULL COMMENT 'IP地址',
`user_agent` varchar(500) DEFAULT NULL COMMENT '浏览器标识',
`sitecode` varchar(100) DEFAULT NULL COMMENT 'sitecode',
`create_at` varchar(24) DEFAULT NULL COMMENT '创建日期',
`create_by` varchar(30) DEFAULT NULL COMMENT '创建者',
`update_at` varchar(24) DEFAULT NULL COMMENT '修改日期',
`update_by` varchar(30) DEFAULT NULL COMMENT '修改者',
`delete_at` varchar(24) DEFAULT NULL COMMENT '删除日期',
`delete_by` varchar(30) DEFAULT NULL COMMENT '删除者,',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='课程学习播放记录';
RENAME TABLE t_lessonlearn TO stats_lesson_learn;
ALTER TABLE `stats_lesson_learn` CHANGE COLUMN `lesson_id` `course_id` varchar(30) NOT NULL COMMENT '课程id';
ALTER TABLE `stats_lesson_learn` CHANGE COLUMN `last_content_id` `last_lesson_id` varchar(30) NOT NULL COMMENT '当前正在学习的课内容ID';
ALTER TABLE `stats_lesson_learn` CHANGE COLUMN `last_content` `last_lesson` varchar(100) NOT NULL COMMENT '当前正在学习的课内容名称';
RENAME TABLE t_lessonlearndetail TO stats_lesson_learn_detail;
ALTER TABLE stats_lesson_learn_detail
CHANGE COLUMN lesson_id
course_id
varchar(30) NOT NULL COMMENT '课程id';
ALTER TABLE stats_lesson_learn_detail
CHANGE COLUMN content_id
lesson_id
varchar(30) NOT NULL COMMENT '当前正在学习的课内容ID';
# 2. Run SQL - 纪录 Lesson 下 每个 tag 的时间
- [ ] Dev
``` sql
alter table stats_lesson_learn_detail
add column `learn_duration` int(11) NOT NULL DEFAULT 0 COMMENT '累计学习时长';
需要跟踪记录的信息
列名: lesson_id > course_id content_id > lesson_id
{ "token":"xTvcFJec", "sitecode": "cine.ios.iphone", "channel": "i5", "locale": "zh_CN", "appver": "2.4.0", "data":{ "cid":"42", "lesson_id":"1315", //新增 替换 content_id "status":1, "last_tag":3, "last_media_id": 'xxxxxxxxxxxxxxxx', //新增 "last_position":1512, "learn_duration":123, //新增 实际播放时长 秒 "content_id":"1315", //待删除 "duration":123, //待删除 } }