修改当作业没有附件时老师能打包下载一个空包的问题
This commit is contained in:
parent
f1aca94a30
commit
edd68baa85
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue