123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_ads` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '标题',
- `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '封面图',
- `weigh` int(11) NOT NULL DEFAULT 0 COMMENT '权重',
- `createtime` int(11) NOT NULL COMMENT '添加时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '轮播图';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_answers` (
- `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- `question_id` int(11) UNSIGNED NOT NULL COMMENT '题目ID',
- `answer_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '答案编号',
- `answer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '答案',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '答案表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_exam` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `subject_id` int(11) NOT NULL DEFAULT 0 COMMENT '科目ID',
- `type` enum('1','2') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '1正式考试 2模拟试题',
- `exam_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '考试名称',
- `question_ids` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '题目ID集合',
- `num` int(11) NOT NULL DEFAULT 0 COMMENT '题目数量',
- `score` int(11) NOT NULL DEFAULT 0 COMMENT '总分数',
- `start_date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- `end_date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- `givetime` int(11) NOT NULL DEFAULT 0 COMMENT '答题时长(分钟)',
- `createtime` int(11) NOT NULL COMMENT '创建时间',
- `status` int(11) NOT NULL DEFAULT 1 COMMENT '1显示 0不显示',
- `sort` int(11) NOT NULL DEFAULT 0,
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测验表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_exam_config` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `exam_id` int(11) NOT NULL COMMENT '测验ID',
- `type` int(11) NOT NULL COMMENT '题目类型',
- `score` decimal(10, 1) NOT NULL COMMENT '分数',
- `num` int(11) NOT NULL COMMENT '数量',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '测验配置表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_exam_user` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `subject_id` int(11) NOT NULL DEFAULT 0 COMMENT '科目id',
- `exam_id` int(11) NOT NULL DEFAULT 0 COMMENT '测验ID',
- `type` int(11) NOT NULL COMMENT '1正式 2模拟',
- `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '学员ID',
- `exam_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '考试名字',
- `begintime` int(11) NOT NULL DEFAULT 0 COMMENT '开始答题时间',
- `up_time` int(11) NOT NULL DEFAULT 0 COMMENT '交卷时间',
- `total_scode` int(11) NOT NULL DEFAULT 0 COMMENT '总分',
- `score` int(11) NOT NULL DEFAULT 0 COMMENT '实际得分',
- `up_status` int(11) NOT NULL DEFAULT 1 COMMENT '是否交卷 1否 2是',
- `endtime` int(11) NOT NULL DEFAULT 0 COMMENT '过期时间',
- `question_ids` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id集合',
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `user_id`(`user_id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '测验答题表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_exam_user_log` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `exam_id` int(11) NOT NULL COMMENT '测验ID',
- `user_id` int(11) NOT NULL COMMENT '学员ID',
- `question_id` int(11) NOT NULL COMMENT '问题ID',
- `user_answer` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '学员答案',
- `lasttime` int(11) NOT NULL COMMENT '最后提交时间',
- `state` int(11) NOT NULL COMMENT '答题状态 0错误 1成功',
- `exam_user_id` int(11) NOT NULL DEFAULT 0,
- `score` int(11) NOT NULL DEFAULT 0,
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `user_id`(`user_id`) USING BTREE,
- INDEX `question_id`(`question_id`) USING BTREE,
- INDEX `exam_user_id`(`exam_user_id`) USING BTREE,
- INDEX `state`(`state`) USING BTREE,
- INDEX `exam_user_id_2`(`exam_user_id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '测验答题详细记录表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_fav` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `user_id` int(11) NOT NULL COMMENT '学员ID',
- `subject_id` int(11) NOT NULL COMMENT '科目id',
- `library_id` int(11) NOT NULL COMMENT '题库ID',
- `unit_id` int(11) NOT NULL COMMENT '章节ID',
- `question_id` int(11) NOT NULL COMMENT '题目id',
- `createtime` int(11) NOT NULL COMMENT '收藏时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '收藏表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_library` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `library_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '题库名称',
- `subject_id` int(11) NOT NULL COMMENT '科目ID',
- `question_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
- `num` int(11) NOT NULL DEFAULT 0,
- `createtime` int(11) NOT NULL COMMENT '创建时间',
- `weigh` int(11) NOT NULL DEFAULT 0,
- `status` int(11) NOT NULL DEFAULT 1 COMMENT '1显示 0隐藏',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '题库表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_question` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `question_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '题目名称',
- `subject_id` int(11) NOT NULL DEFAULT 0 COMMENT '科目ID',
- `library_id` int(11) NOT NULL DEFAULT 0,
- `unit_id` int(11) NOT NULL DEFAULT 0 COMMENT '章节ID',
- `type` enum('1','2','3') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '题目类型 1单选 2多选 3判断',
- `right_answer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '正确答案',
- `area` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '备注/解析',
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `subject_id`(`subject_id`) USING BTREE,
- INDEX `unit_id`(`unit_id`) USING BTREE,
- INDEX `id`(`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '题目表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_question_log` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户uid',
- `subject_id` int(11) NOT NULL DEFAULT 0 COMMENT '科目id',
- `unit_id` int(11) NOT NULL DEFAULT 0 COMMENT '章节id',
- `library_id` int(11) NOT NULL DEFAULT 0 COMMENT '题库id',
- `question_id` int(11) NOT NULL DEFAULT 0 COMMENT '题目id',
- `state` tinyint(4) NOT NULL COMMENT '答题状态:1正确 0错误',
- `createtime` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间',
- `lasttime` int(11) NOT NULL,
- `error_num` int(11) NOT NULL DEFAULT 0 COMMENT '错误记录',
- `total_num` int(11) NOT NULL DEFAULT 0 COMMENT '答题总记录',
- PRIMARY KEY (`id`) USING BTREE,
- UNIQUE INDEX `id`(`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '题库记录';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_subject` (
- `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- `subject_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '科目名称',
- `status` int(11) NOT NULL DEFAULT 1 COMMENT '1显示 0不显示',
- `weigh` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
- `createtime` int(11) NOT NULL COMMENT '创建时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '科目表';
- CREATE TABLE IF NOT EXISTS `__PREFIX__yexam_unit` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `pid` int(11) NOT NULL DEFAULT 0 COMMENT '上级章节ID',
- `subject_id` int(11) NOT NULL COMMENT '科目ID',
- `unit_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '章节名称',
- `is_last` int(11) NOT NULL DEFAULT 1 COMMENT '是否为终极章节 1是 0否',
- `status` int(11) NOT NULL DEFAULT 1 COMMENT '1 显示 0隐藏',
- `createtime` int(11) NOT NULL COMMENT '创建时间',
- `sort` int(11) NOT NULL DEFAULT 0,
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '章节表';
- CREATE TABLE `__PREFIX__yexam_third` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `user_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '会员ID',
- `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源',
- `openid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'openID',
- `nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '会员昵称',
- `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '头像',
- `createtime` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '创建时间',
- `updatetime` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '更新时间',
- PRIMARY KEY (`id`) USING BTREE,
- UNIQUE INDEX `platform`(`openid`) USING BTREE,
- INDEX `user_id`(`user_id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '第三方登录表';
|