From 1d53060af9fac34eca718239260b93ac5ca8aa76 Mon Sep 17 00:00:00 2001 From: daiao <35855898@qq.com> Date: Tue, 12 Mar 2019 09:47:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E8=AE=A4=E8=AF=81=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ec_courses_controller.rb | 2 +- app/views/ec_major_schools/_year_list.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/ec_courses_controller.rb b/app/controllers/ec_courses_controller.rb index ebd9ca1a..0ad029f4 100644 --- a/app/controllers/ec_courses_controller.rb +++ b/app/controllers/ec_courses_controller.rb @@ -630,7 +630,7 @@ class EcCoursesController < ApplicationController # 遍历学生成绩统计数据 student_scores.each do |sc| sub_ecss = EcCourseStudentScore.where(:ec_course_id => @ec_course.id, :ec_year_student_id => sc.ec_year_student_id).first - sub_score = base_score == 0 ? 0 : ((sc.try(:score).to_f/base_score) * percentage).round(3) + sub_score = base_score == 0 || sc.try(:score).nil? ? 0 : ((sc.try(:score).to_f/base_score) * percentage).round(3) if sub_ecss ess_target = sub_ecss.ec_student_score_targets.where(:ec_course_target_id => target.id, diff --git a/app/views/ec_major_schools/_year_list.html.erb b/app/views/ec_major_schools/_year_list.html.erb index 98a04678..5fd7bab1 100644 --- a/app/views/ec_major_schools/_year_list.html.erb +++ b/app/views/ec_major_schools/_year_list.html.erb @@ -49,7 +49,7 @@ - <% if @major_manager && !@major_school.template_major %> + <% if @major_manager && !@major_school.template_major || User.current.admin? %> 删除 <% end %> <%#= link_to '删除', ec_major_school_ec_year_path(year, :ec_major_school_id => @major_school), method: :delete, :class => "mr15 color-grey-c", data: { confirm: '您确定要删除吗' } %>