count为空的情况

develop
wangxu 2 years ago
parent 944781887f
commit 55c9b7b9cd

@ -262,8 +262,8 @@ class EcCourseEvaluationsController < ApplicationController
start_column = 0
end
count = @ce.evluation_count * @ce.ec_course_evaluation_subitems.count # 考核次数与分项的笛卡尔积
for i in 1 .. @ce.evluation_count do
count = (@ce.evluation_count || 1) * (@ce.ec_course_evaluation_subitems.count || 1) # 考核次数与分项的笛卡尔积
for i in 1 .. (@ce.evluation_count || 1) do
@ce.ec_course_evaluation_subitems.each_with_index do |item, j|
current_column = start_column + @ce.ec_course_evaluation_subitems.count * (i-1) + j
sheet1[1, current_column] = "#{@ce.name}#{i}#{item.name}"

Loading…
Cancel
Save