From 7e4bdd51abde93ae0141f8429fd9a761c92b5377 Mon Sep 17 00:00:00 2001 From: daiao <35855898@qq.com> Date: Sat, 9 Mar 2019 14:30:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B7=AF=E5=BE=84=E5=88=B0?= =?UTF-8?q?=E5=A4=84=E5=A2=9E=E5=8A=A0=E8=AF=BE=E7=A8=8B=E4=BD=93=E7=B3=BB?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E8=AE=AD=E7=9A=84=E5=8F=91=E5=B8=83=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 14 ++++++++++---- app/models/subject.rb | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index fe5aa922..300f8911 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -4098,7 +4098,7 @@ end book = Spreadsheet::Workbook.new sheet1 = book.create_worksheet :name => "已发布实训课程" count_row = 2 - sheet1.row(1).concat(["", "地址", "实训课程名称","章节名称", "实训组成", "关卡数", "状态", "更新时间"]) + sheet1.row(1).concat(["", "地址", "实训课程名称","章节名称", "实训组成", "关卡数", "状态", "课程等级", "更新时间", "发布时间", ]) Rails.logger.warn("##########subjects:#{subjects.count}") subjects.each do |subject| sheet1[count_row,1] = "paths/"+subject.id.to_s @@ -4112,19 +4112,25 @@ end sheet1[count_row,5] = shixun.challenges.count sheet1[count_row,6] = shixun.shixun_status if s_index == 0 && index == 0 - sheet1[count_row,7] = format_time subject.updated_at + sheet1[count_row,7] = subject.subject_level_system.try(:name) || "--" + sheet1[count_row,8] = format_time subject.updated_at + sheet1[count_row,9] = format_time subject.publish_time end count_row += 1 end else if s_index == 0 - sheet1[count_row,7] = format_time subject.updated_at + sheet1[count_row,7] = subject.subject_level_system.try(:name) || "--" + sheet1[count_row,8] = format_time subject.updated_at + sheet1[count_row,9] = format_time subject.publish_time end count_row += 1 end end else - sheet1[count_row,7] = format_time subject.updated_at + sheet1[count_row,7] = subject.subject_level_system.try(:name) || "--" + sheet1[count_row,8] = format_time subject.updated_at + sheet1[count_row,9] = format_time subject.publish_time count_row += 1 end end diff --git a/app/models/subject.rb b/app/models/subject.rb index bd92c39c..59e84ee3 100644 --- a/app/models/subject.rb +++ b/app/models/subject.rb @@ -18,7 +18,7 @@ class Subject < ActiveRecord::Base has_many :tidings, :as => :container, :dependent => :destroy belongs_to :repertoire belongs_to :user - has_one :subject_level_system + belongs_to :subject_level_system scope :visible, lambda{where(status: 2)}