|
|
|
@ -4,7 +4,12 @@ class UpdateExeriseUserEndAt < ActiveRecord::Migration
|
|
|
|
|
exercise.exercise_group_settings.each do |group|
|
|
|
|
|
if group.end_time.present? && group.end_time < Time.now
|
|
|
|
|
user_ids = exercise.course.members.where(:course_group_id => group.course_group_id).map(&:user_id)
|
|
|
|
|
exercise.exercise_users.where(:commit_status => 1, :user_id => user_ids).update_all(:end_at => group.end_time)
|
|
|
|
|
if group.id == 1390 || group.id == 1387 # 黄颖
|
|
|
|
|
exercise.exercise_users.where("end_at < '2019-04-19 01:08:00'").where(:commit_status => 1, :user_id => user_ids).update_all(:end_at => group.end_time)
|
|
|
|
|
elsif group.id == 1391 || group.id == 1389 # 黄颖
|
|
|
|
|
exercise.exercise_users.where("end_at < '2019-04-19 02:58:00'").where(:commit_status => 1, :user_id => user_ids).update_all(:end_at => group.end_time)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|