xlsx导出的部分优化

dev_course
SylorHuang 5 years ago
parent 7fa0c60a1a
commit 5cdc8bb687

@ -107,15 +107,9 @@ class HomeworkCommonsController < ApplicationController
student_works = @homework.all_works student_works = @homework.all_works
@all_member_count = student_works.size @all_member_count = student_works.size
logger.info("###########______@homework.publish_time_________#{@homework.publish_time}")
logger.info("-----------------------------------------------------")
if @homework.publish_time.blank? || (@homework.publish_time > Time.now) if @homework.publish_time.blank? || (@homework.publish_time > Time.now)
logger.info("+++++++++++++++++#{@homework.publish_time}")
@student_works = [] @student_works = []
if (params[:format] == "xlsx") || (params[:format] == "zip") if (params[:format] == "xlsx") || (params[:format] == "zip")
logger.info("++++++params[:format]params[:format]params[:format]params[:format]+++++++++++#{params[:format]}")
normal_status(-1,"作业未发布") normal_status(-1,"作业未发布")
end end
else else

@ -49,7 +49,7 @@ wb.styles do |s|
end #each_with_index end #each_with_index
sheet.add_row poll_users_info, :height =>15, :style => blue_cell sheet.add_row poll_users_info, :height =>15, :style => blue_cell
poll_users.each_with_index do |u,index| poll_users.includes(user: :user_extension).each_with_index do |u,index|
u_user = u.user u_user = u.user
user_answer_array = [] user_answer_array = []
poll_questions.each do |q| poll_questions.each do |q|

Loading…
Cancel
Save