|
|
@ -43,7 +43,7 @@ class CompetitionTeamsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 课堂
|
|
|
|
# 课堂
|
|
|
|
student_count_subquery = CourseMember.where('course_id = courses.id AND role = 5').select('count(*)').to_sql
|
|
|
|
student_count_subquery = CourseMember.where('course_id = courses.id AND role = 4').select('count(*)').to_sql
|
|
|
|
subquery = StudentWork.where('homework_common_id = hcs.id')
|
|
|
|
subquery = StudentWork.where('homework_common_id = hcs.id')
|
|
|
|
.select('sum(compelete_status !=0 ) as finish, count(*) as total')
|
|
|
|
.select('sum(compelete_status !=0 ) as finish, count(*) as total')
|
|
|
|
.having('total != 0 and finish >= (total / 2)').to_sql
|
|
|
|
.having('total != 0 and finish >= (total / 2)').to_sql
|
|
|
|