|
@@ -402,19 +402,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
u.user_id,
|
|
|
cgu.`status`,
|
|
|
u.realname,
|
|
|
- (SELECT cgg.goods_id FROM class_grade_goods cgg where cg.grade_id=cgg.grade_id) as goods_id,
|
|
|
+ og.goods_id,
|
|
|
u.id_card,
|
|
|
cgu.grade_id,
|
|
|
u.telphone,
|
|
|
(case WHEN (select COUNT(uu.id) FROM user_update uu where cgu.user_id = uu.user_id and uu.status = 2) >0 then 1 ELSE 0 end) as user_status,
|
|
|
(case WHEN cgu.official_status_time > (select MAX(uu.create_time) FROM user_update uu where cgu.user_id = uu.user_id) then 0 ELSE 1 end) as user_info_status,
|
|
|
(select MAX(uu.create_time) FROM user_update uu where cgu.user_id = uu.user_id ) as update_info_time,
|
|
|
- (SELECT g.class_hours FROM goods g LEFT JOIN class_grade_goods cgg on cgg.goods_id = g.goods_id where cg.grade_id = cgg.grade_id) as class_hours,
|
|
|
+ g.class_hours,
|
|
|
cgu.period_status,
|
|
|
cgu.finish_status,
|
|
|
cgu.period_plush,
|
|
|
- (SELECT g.study_start_time FROM goods g LEFT JOIN class_grade_goods cgg on cgg.goods_id = g.goods_id where cg.grade_id = cgg.grade_id) as study_start_time,
|
|
|
- (SELECT g.study_end_time FROM goods g LEFT JOIN class_grade_goods cgg on cgg.goods_id = g.goods_id where cg.grade_id = cgg.grade_id) as study_end_time,
|
|
|
+ g.study_start_time,
|
|
|
+ g.study_end_time,
|
|
|
cg.class_start_time,
|
|
|
cg.class_end_time,
|
|
|
cg.interface_push_id,
|
|
@@ -422,8 +422,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
cgu.official_status_msg,
|
|
|
cgu.period_plush_msg,
|
|
|
cgu.learn_status,
|
|
|
- (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id LEFT JOIN class_grade_goods cgg on cgg.goods_id = c.goods_id where cg.grade_id=cgg.grade_id and m.type in (1,3) ) as exam_num,
|
|
|
- (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id = ubr.goods_id where ubr.`status`=1 and ubr.type in (1,3) and ubr.user_id = u.user_id and ubr.grade_id = cgu.grade_id and ubr.report_status=1 and ubr.current_status = 1) as record_num,
|
|
|
+ (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id where c.goods_id=og.goods_id and m.type in (1,3) ) as exam_num,
|
|
|
+ (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr where ubr.`status`=1 and ubr.type in (1,3) and ubr.user_id = u.user_id and ubr.order_goods_id = cgu.order_goods_id and ubr.report_status=1 and ubr.current_status = 1) as record_num,
|
|
|
(og.study_count) as study_count,
|
|
|
og.order_goods_id,
|
|
|
og.rebuy_order_goods_id,
|
|
@@ -465,12 +465,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and cgu.grade_id = #{gradeId}
|
|
|
</if>
|
|
|
<if test="choice != null and choice == 1 ">
|
|
|
- and (SELECT COUNT(cge.grade_id) FROM class_grade cge LEFT JOIN class_grade_user cgur on cge.grade_id = cgur.grade_id where cgu.user_id =cgur.user_id and (SELECT cgg.goods_id FROM class_grade_goods cgg where cge.grade_id=cgg.grade_id) = (SELECT cgg.goods_id FROM class_grade_goods cgg where cg.grade_id=cgg.grade_id) AND (unix_timestamp(now()) < cge.class_end_time or cge.class_start_time is null) and cge.`status`=1 and cgur.`status` =1)= 0 and cgu.period_status=0
|
|
|
+ and (SELECT COUNT(cge.grade_id) FROM class_grade cge LEFT JOIN class_grade_user cgur on cge.grade_id = cgur.grade_id where cgu.user_id =cgur.user_id and cgur.order_goods_id = cgu.order_goods_id AND (unix_timestamp(now()) < cge.class_end_time or cge.class_start_time is null) and cge.`status`=1 and cgur.`status` =1)= 0 and cgu.period_status=0
|
|
|
AND (SELECT COUNT(cgde.grade_id) FROM class_grade cgde where cgde.grade_id = cg.grade_id and (unix_timestamp(now()) < cgde.class_end_time or cgde.class_start_time is null)) =0
|
|
|
</if>
|
|
|
<if test="choice != null and choice == 2 ">
|
|
|
- and (SELECT COUNT(cge.grade_id) FROM class_grade cge LEFT JOIN class_grade_user cgur on cge.grade_id = cgur.grade_id where cgu.user_id =cgur.user_id and (SELECT cgg.goods_id FROM class_grade_goods cgg
|
|
|
- where cge.grade_id=cgg.grade_id) = (SELECT cgg.goods_id FROM class_grade_goods cgg where cg.grade_id=cgg.grade_id) AND (unix_timestamp(now()) < cge.class_end_time or cge.class_start_time is null)
|
|
|
+ and (SELECT COUNT(cge.grade_id) FROM class_grade cge LEFT JOIN class_grade_user cgur on cge.grade_id = cgur.grade_id where cgu.user_id =cgur.user_id and cgur.order_goods_id = cgu.order_goods_id AND (unix_timestamp(now()) < cge.class_end_time or cge.class_start_time is null)
|
|
|
and cge.`status`=1 and cgur.`status` =1)> 0
|
|
|
AND (SELECT COUNT(cgde.grade_id) FROM class_grade cgde where cgde.grade_id = cg.grade_id and (unix_timestamp(now()) < cgde.class_end_time or cgde.class_start_time is null)) =0
|
|
|
</if>
|