From 06122dab1dfad02ea5d9c36a2c36b08655153b72 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 4 Dec 2015 11:24:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=A4=A9=E6=88=AA=E6=AD=A2=E7=9A=84?= =?UTF-8?q?=E6=B5=8B=E9=AA=8C=E9=9C=80=E8=A6=81=E5=8F=91=E5=B8=83=E6=88=AA?= =?UTF-8?q?=E6=AD=A2=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/exercise_close_to_deadline_warn.rake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/tasks/exercise_close_to_deadline_warn.rake b/lib/tasks/exercise_close_to_deadline_warn.rake index 2af513ee8..890191167 100644 --- a/lib/tasks/exercise_close_to_deadline_warn.rake +++ b/lib/tasks/exercise_close_to_deadline_warn.rake @@ -3,9 +3,8 @@ namespace :exercise_deadline_warn do desc "exercise deadline warn" task :deadline_warn => :environment do - exercises = Exercise.where("date_format(end_time,'%Y-%m-%d')= '#{Date.today}'") #截止日期都是当天 23.59分,所以年月日相等的一定是今晚会截止的测验 + exercises = Exercise.where("exercise_status = 2 and date_format(end_time,'%Y-%m-%d')= '#{Date.today}'") #截止日期都是当天 23.59分,所以年月日相等的一定是今晚会截止的测验 exercises.each do |exercise| - if exercise.exercise_status == 2 #发布的作业才能告给学生发截止消息 course = exercise.course course.members.each do |m| #CourseMessage status 1 未发布 status 2 已发布 status 3 已发布快截止了 @@ -16,7 +15,6 @@ namespace :exercise_deadline_warn do # end # 邮件通知 #Mailer.run.homework_added(homework) - end end end end \ No newline at end of file