From 7454064a9c798cdf73045fb12186375b4d2293b0 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 26 Mar 2019 23:23:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E7=BB=A9=E5=AF=BC=E5=87=BA=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 9a84fc6b..57d57938 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1194,6 +1194,13 @@ class CoursesController < ApplicationController @exercises = @course.exercises.where("publish_time <= '#{Time.now}'").order("publish_time asc, created_at asc") @tasks = @course.graduation_tasks.where("publish_time <= '#{Time.now}'").order("publish_time asc, created_at asc") + @homeworks.where(:homework_type => 4).each do |homework| + items = homework.student_works.where("work_status != 0") + if items.count == 0 && homework.publish_time < Time.now && !@course.is_end + update_shixun_work_status homework + end + end + respond_to do |format| format.xls { send_data(member_to_xls(@homeworks, @exercises, @tasks, @course,@all_members,@course.course_groups), :type => "text/excel;charset=utf-8; header=present",