|
|
@ -382,7 +382,7 @@ class CompetitionTeamsController < ApplicationController
|
|
|
|
.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
|
|
|
|
Shixun.joins(homework_commons_shixuns: :homework_common)
|
|
|
|
Shixun.joins(homework_commons_shixuns: :homework_common)
|
|
|
|
.where(homework_commons: { homework_type: 3 })
|
|
|
|
.where(homework_commons: { homework_type: 4 })
|
|
|
|
.where('course_id in (?)', ids)
|
|
|
|
.where('course_id in (?)', ids)
|
|
|
|
.where("exists (#{percentage_sql})")
|
|
|
|
.where("exists (#{percentage_sql})")
|
|
|
|
.group('course_id').count
|
|
|
|
.group('course_id').count
|
|
|
|