From 149b837afff78880c99b1d26f3b8c4634d015fd8 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 9 Mar 2017 13:58:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=90=AF=E7=94=A8=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E7=9A=84=E9=BB=98=E8=AE=A4=E8=AE=BE=E7=BD=AE=E5=87=BA?= =?UTF-8?q?=E9=94=99=EF=BC=8C=E5=8F=AA=E4=BD=99=E4=B8=80=E5=A4=A9=E7=9A=84?= =?UTF-8?q?=E6=9C=9F=E9=97=B4=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 2 +- app/controllers/users_controller.rb | 4 ++-- app/models/homework_common.rb | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index cb6c1505b..1812e7cff 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -156,7 +156,7 @@ class HomeworkCommonController < ApplicationController eval_start = homework_detail_manual.evaluation_start if eval_start.nil? || (Time.parse(eval_start.to_s) <= @homework.end_time && homework_detail_manual.comment_status <= 1) - homework_detail_manual.evaluation_start = @homework.end_time + 7 + homework_detail_manual.evaluation_start = (@homework.end_time + 7*24*60*60).strftime("%Y-%m-%d") homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7 end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 41c62cf85..805cbcf6a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1436,8 +1436,8 @@ class UsersController < ApplicationController end end - homework_detail_manual.evaluation_start = homework.end_time + 7 if homework.end_time - homework_detail_manual.evaluation_end = homework.end_time + 14 if homework.end_time + homework_detail_manual.evaluation_start = (homework.end_time + 7*24*60*60).strftime("%Y-%m-%d") if homework.end_time + homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7 if homework.end_time homework_detail_manual.evaluation_num = params[:evaluation_num] || 3 homework_detail_manual.absence_penalty = 0 homework.homework_detail_manual = homework_detail_manual diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 3323fb331..440eff661 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -111,8 +111,9 @@ class HomeworkCommon < ActiveRecord::Base #作业微信通知delay def send_homework_wechat_message_delay self.course.members.each do |m| - # if m.user_id != self.user_id - #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) + if m.user_id != self.user_id + self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) + end rolesids = [] m.roles.each do |role| rolesids << role.id