dev_forum
cxt 6 years ago
parent 8afb881a17
commit 877ee82230

@ -195,7 +195,6 @@ class HomeworkCommonsController < ApplicationController
end end
if params[:format] == "xlsx" if params[:format] == "xlsx"
@work_excel = @work_excel.includes(:student_works_scores, user: :user_extension, myshixun: :games)
complete_works = @work_excel.present? ? @work_excel.where("work_status > 0").size : 0 complete_works = @work_excel.present? ? @work_excel.where("work_status > 0").size : 0
if @user_course_identity >= Course::STUDENT if @user_course_identity >= Course::STUDENT
tip_exception(403, "无权限操作") tip_exception(403, "无权限操作")

@ -109,11 +109,11 @@ class ZipsController < ApplicationController
work_status = params[:work_status] work_status = params[:work_status]
group_id = params[:course_group] group_id = params[:course_group]
if work_status.present? unless work_status.blank?
@all_student_works = @all_student_works.where(work_status:work_status) @all_student_works = @all_student_works.where(work_status:work_status)
end end
if group_id.present? unless group_id.blank?
group_user_ids = @course.students.where(course_group_id: params[:course_group]).pluck(:user_id) group_user_ids = @course.students.where(course_group_id: params[:course_group]).pluck(:user_id)
@all_student_works = @all_student_works.where(user_id: group_user_ids) @all_student_works = @all_student_works.where(user_id: group_user_ids)
end end

Loading…
Cancel
Save