修复课程中心问题

beetlsql3-dev
whb 7 months ago
parent ab10556661
commit cbebfe905c

@ -382,59 +382,72 @@ getSchoolStartCourse
getTeacherOpenCourseMergeCourseInfo getTeacherOpenCourseMergeCourseInfo
=== ===
* 获取教师开课课程,以及授权课程 * 获取教师开课课程,以及授权课程
(
( SELECT
SELECT 1 type,
1 `type`, a.teacher_open_course_id,
a.teacher_open_course_id, a.teacher_open_course_title course_name,
a.teacher_open_course_title `course_name`, a.teacher_open_course_cover course_cover,
a.teacher_open_course_cover `course_cover`, t.teacher_name name,
t.teacher_name `name`, a.start_time
a.start_time FROM teacher_open_course a
FROM teacher_open_course a LEFT JOIN teacher_open_course_merge_teacher tocmt on a.teacher_open_course_id = tocmt.teacher_open_course_id
LEFT JOIN teacher_open_course_merge_teacher tocmt on a.teacher_open_course_id = tocmt.teacher_open_course_id LEFT JOIN teacher t on t.teacher_id = tocmt.teacher_id
LEFT JOIN teacher t on t.teacher_id = tocmt.teacher_id WHERE 1 = 1
WHERE 1 = 1 AND a.teacher_open_course_status = 1
AND a.teacher_open_course_status = 1 AND tocmt.teacher_open_course_merge_teacher_status=1
AND tocmt.teacher_open_course_merge_teacher_status=1 AND t.teacher_status=1
AND t.teacher_status=1 @if(!isEmpty(orgId)){
@if(!isEmpty(orgId)){ AND a.org_id = #orgId#
AND a.org_id =#orgId# @}
@} AND (
@if(!isEmpty(courseLabelId)){ @if(!isEmpty(courseLabelId)){
AND a.teacher_open_course_id in ( a.teacher_open_course_id in (
select teacher_open_course_id from teacher_open_course_merge_course_info c where c.course_label_id = #courseLabelId# and c.course_info_type = 1 and c.course_info_status = 1 select teacher_open_course_id
) from teacher_open_course_merge_course_info c
@} where c.course_label_id = #courseLabelId#
@if(!isEmpty(filterStartTime) && !isEmpty(filterEndTime)){ and c.course_info_type = 1
AND a.start_time BETWEEN #filterStartTime# AND #filterEndTime# and c.course_info_status = 1
@} )
@} else {
) 1 = 1 -- 当 courseLabelId 为空时不做限制
UNION ALL @}
( )
select @if(!isEmpty(filterStartTime) && !isEmpty(filterEndTime)){
2 `type`, AND a.start_time BETWEEN #filterStartTime# AND #filterEndTime#
ci.course_info_id `teacher_open_course_id`, @}
ci.course_info_name `course_name`, )
ci.course_info_thumbnail `course_cover`, UNION ALL
'系统管理员' `name`, (
ucjcr.use_start_time AS start_time SELECT
from universities_colleges uc 2 type,
LEFT JOIN universities_colleges_jurisdiction_curriculum_resources ucjcr ON ucjcr.universities_colleges_id = uc.universities_colleges_id ci.course_info_id teacher_open_course_id,
LEFT JOIN course_info ci ON ci.course_info_id = ucjcr.course_info_id AND ci.course_info_type =1 ci.course_info_name course_name,
where 1 = 1 ci.course_info_thumbnail course_cover,
and uc.universities_colleges_status = 1 '系统管理员' name,
and ci.course_info_status = 1 ucjcr.use_start_time AS start_time
and ucjcr.use_type in (1,2) FROM universities_colleges uc
and now() between ucjcr.use_start_time and ucjcr.use_end_time LEFT JOIN universities_colleges_jurisdiction_curriculum_resources ucjcr
@if(!isEmpty(orgId)){ ON ucjcr.universities_colleges_id = uc.universities_colleges_id
AND uc.org_id =#orgId# LEFT JOIN course_info ci
@} ON ci.course_info_id = ucjcr.course_info_id
@if(!isEmpty(courseLabelId)){ AND ci.course_info_type = 1
and ci.course_label_id = #courseLabelId# WHERE 1 = 1
@} AND uc.universities_colleges_status = 1
@if(!isEmpty(filterStartTime) && !isEmpty(filterEndTime)){ AND ci.course_info_status = 1
AND ucjcr.use_start_time BETWEEN #filterStartTime# AND #filterEndTime# AND ucjcr.use_type IN (1, 2)
@} AND NOW() BETWEEN ucjcr.use_start_time AND ucjcr.use_end_time
) @if(!isEmpty(orgId)){
AND uc.org_id = #orgId#
@}
AND (
@if(!isEmpty(courseLabelId)){
ci.course_label_id = #courseLabelId#
@} else {
1 = 1 -- 当 courseLabelId 为空时不做限制
@}
)
@if(!isEmpty(filterStartTime) && !isEmpty(filterEndTime)){
AND ucjcr.use_start_time BETWEEN #filterStartTime# AND #filterEndTime#
@}
)

Loading…
Cancel
Save