“我的作业”中有挂起的作业时会报500
This commit is contained in:
parent
bae0562b97
commit
80b8fc4444
|
@ -1534,7 +1534,7 @@ class UsersController < ApplicationController
|
||||||
stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
|
stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
|
||||||
stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
|
stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
|
||||||
@receive_homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc").limit(5)
|
@receive_homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc").limit(5)
|
||||||
if (@manage_homeworks.empty? && @receive_homeworks.empty?) || (@receive_homeworks.empty?) || (!@manage_homeworks.empty? && !@receive_homeworks.empty? && @manage_homeworks.first.publish_time > @receive_homeworks.first.publish_time)
|
if (@manage_homeworks.empty? && @receive_homeworks.empty?) || (@receive_homeworks.empty?) || (!@manage_homeworks.empty? && !@receive_homeworks.empty? && @manage_homeworks.first.created_at > @receive_homeworks.first.created_at)
|
||||||
@manage_pre = true
|
@manage_pre = true
|
||||||
else
|
else
|
||||||
@manage_pre = false
|
@manage_pre = false
|
||||||
|
|
Loading…
Reference in New Issue