From 4eabca3a2e332b1ffc1ef1fdc3c9240910f4cede Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 2 Aug 2019 18:14:05 +0800 Subject: [PATCH] modify --- app/controllers/competition_teams_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/competition_teams_controller.rb b/app/controllers/competition_teams_controller.rb index f115a610..933fc4df 100644 --- a/app/controllers/competition_teams_controller.rb +++ b/app/controllers/competition_teams_controller.rb @@ -49,7 +49,7 @@ class CompetitionTeamsController < ApplicationController .having('total != 0 and finish >= (total / 2)').to_sql course_ids = Course.where('courses.created_at > ?', Time.parse('2018-06-01')) .where('courses.created_at <= ?', @competition.end_time) - .where("(#{student_count_subquery}) >= 10") + .where("(#{student_count_subquery}) >= 3") .where("exists(select 1 from homework_commons hcs where hcs.course_id = courses.id and hcs.publish_time is not null and hcs.publish_time < NOW() and hcs.homework_type = 4 and exists(#{subquery}))") .joins('join course_members on course_members.course_id = courses.id and course_members.role in (1,2,3)') .where(course_members: { user_id: @team_user_ids }).pluck(:id)