diff --git a/app/controllers/ec_courses_controller.rb b/app/controllers/ec_courses_controller.rb index fea8ffcc..ae02ea2b 100644 --- a/app/controllers/ec_courses_controller.rb +++ b/app/controllers/ec_courses_controller.rb @@ -724,8 +724,12 @@ class EcCoursesController < ApplicationController va = total_rate.select{|tra| tra[:position] == po}.first reach_real_target += va[:score] * va[:rate] if va.present? end + + Rails.logger.info("######round11111111#{(target_total_rates == 0 ? 0 : (reach_real_target * weight)/(target_total_rates.round(3)*100))}") reach_real_target = target_total_rates == 0 ? 0 : (reach_real_target * weight)/(target_total_rates*100) + Rails.logger.info("######round2222222#{reach_real_target}") + if ec_course_support.present? logger.info("----------ec_course_support: #{ec_course_support.id}") egrc = ec_course_support.ec_graduation_requirement_calculation diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 19c82857..3d980718 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -71,11 +71,11 @@ module ApplicationHelper end def ac_pass?(standard_value, real_value) - standard_value && real_value && real_value > standard_value ? "达成" : "未达成" + standard_value && real_value && real_value >= standard_value ? "达成" : "未达成" end def ec_pass?(standard_value, real_value) - standard_value && real_value && real_value > standard_value ? 1 : 0 + standard_value && real_value && real_value >= standard_value ? 1 : 0 end # 工程认证删除关联课堂 diff --git a/db/migrate/20190320023642_migrate_user_grade.rb b/db/migrate/20190320023642_migrate_user_grade.rb new file mode 100644 index 00000000..b59640a5 --- /dev/null +++ b/db/migrate/20190320023642_migrate_user_grade.rb @@ -0,0 +1,8 @@ +class MigrateUserGrade < ActiveRecord::Migration + def up + change_column :users, :grade, :integer, :default => 0 + end + + def down + end +end