dev_local_2
cxt 6 years ago
parent 891dae66a7
commit 7c975c9092

@ -164,14 +164,8 @@ class HomeworkCommonsController < ApplicationController
all_student_works = @student_works.left_joins(:myshixun)
@student_works = all_student_works.where(work_status: work_status)
if work_status.include?(3)
# ids = all_student_works.joins(:myshixun).where(myshixuns: {status: 0}).pluck(:id)
@student_works = @student_works.or(all_student_works.where(work_status: 0)).or(all_student_works.where(myshixuns: {status: 0}))
end
if work_status.include?(4)
# ids = all_student_works.joins(:myshixun).where(myshixuns: {status: 1}).pluck(:id)
@student_works = @student_works.or(all_student_works.where(myshixuns: {status: 1}))
end
@student_works = @student_works.or(all_student_works.where(work_status: 0)).or(all_student_works.where(myshixuns: {status: 0})) if work_status.include?(3)
@student_works = @student_works.or(all_student_works.where(myshixuns: {status: 1})) if work_status.include?(4)
end
# 分班情况

Loading…
Cancel
Save