This commit is contained in:
cxt 2016-09-06 18:01:16 +08:00
parent 8edfec258b
commit 7b2943c37a
1 changed files with 1 additions and 1 deletions

View File

@ -773,7 +773,7 @@ class StudentWorkController < ApplicationController
pros = @work.student_work_projects.where("is_leader = 0")
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
student_works = @homework.student_works.where("user_id in #{user_ids}")
student_works.update_all(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil, :project_id => 0)
student_works.delete_all
pros.delete_all
project = @work.student_work_projects.where("is_leader = 1").first