diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 0286fcad6..a9adc9ec6 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -433,8 +433,8 @@ class HomeworkAttachController < ApplicationController #删除留言 def destroy_jour - @homework = HomeworkAttach.find(params[:jour_id]) + @course=@homework.bid.courses.first @journal_destroyed = JournalsForMessage.find(params[:object_id]) @is_comprehensive_evaluation = @journal_destroyed.is_comprehensive_evaluation @journal_destroyed.destroy diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index d7f9fa0ac..6cbe0dd95 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -21,7 +21,13 @@ class ZipdownController < ApplicationController def assort if params[:obj_class] == "Bid" bid = Bid.find params[:obj_id] - zipfile = zip_bid bid + file_count = 0 + bid.homeworks.map { |homework| file_count += homework.attachments.count} + if file_count > 0 + zipfile = zip_bid bid + else + render file: 'public/no_file_found.html' + end else logger.error "[ZipDown#assort] ===> #{params[:obj_class]} unKown !!" end diff --git a/app/views/bids/_alert_anonyoms.html.erb b/app/views/bids/_alert_anonyoms.html.erb index 6205b2b6c..e4e9076a5 100644 --- a/app/views/bids/_alert_anonyoms.html.erb +++ b/app/views/bids/_alert_anonyoms.html.erb @@ -3,7 +3,7 @@