dev_aliyun
p31729568 5 years ago
parent 4eabca3a2e
commit 4ac5ddc655

@ -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')
.select('sum(compelete_status !=0 ) as finish, count(*) as total')
.having('total != 0 and finish >= (total / 2)').to_sql

Loading…
Cancel
Save