From 8ff3dc567bb7dede514b1bea729f07221b14a4d5 Mon Sep 17 00:00:00 2001 From: wangxu <675649451@qq.com> Date: Thu, 23 Jun 2022 15:59:38 +0800 Subject: [PATCH] =?UTF-8?q?count=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ec_course_evaluations_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/ec_course_evaluations_controller.rb b/app/controllers/ec_course_evaluations_controller.rb index 52da9c86..58647589 100644 --- a/app/controllers/ec_course_evaluations_controller.rb +++ b/app/controllers/ec_course_evaluations_controller.rb @@ -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}"