dev_local_2
cxt 5 years ago
parent 0ef6e68eb5
commit 6845b1b634

@ -161,10 +161,11 @@ class HomeworkCommonsController < ApplicationController
# 作品状态 0 未提交, 1 按时提交, 2 延迟提交
if params[:work_status].present?
work_status = params[:work_status].map{|status| status.to_i}
all_student_works = @student_works
all_student_works = @student_works.joins(:myshixun)
@student_works = all_student_works.where(work_status: work_status)
@student_works = @student_works.or(all_student_works.where(work_status: 0)).or(all_student_works.joins(:myshixun).where(status: 0)) if work_status.include?(3)
@student_works = @student_works.or(all_student_works.joins(:myshixun).where(status: 1)) if work_status.include?(4)
@student_works = @student_works.or(all_student_works.where(work_status: 0)).or(all_student_works.where(myshixun: {status: 0})) if work_status.include?(3)
@student_works = @student_works.or(all_student_works.where(myshixun: {status: 0})) if work_status.include?(4)
end
# 分班情况

Loading…
Cancel
Save