From 525b47e36c74f621997ebdc88bd1aafe13c7efc2 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 13 Jun 2019 16:21:02 +0800 Subject: [PATCH] modify --- app/controllers/managements_controller.rb | 24 ++++++++++++----------- app/controllers/trainings_controller.rb | 4 +++- app/views/trainings/enroll.html.erb | 22 ++++++--------------- 3 files changed, 22 insertions(+), 28 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 769481b0..db74d39a 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -4151,7 +4151,7 @@ end sheet1 = book.create_worksheet :name => "sheet" blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 sheet1.row(0).default_format = blue - sheet1.row(0).concat(["姓名", "手机号","邮箱","单位名称", "职位","专业", "学号", "支付方式","支付状态","支付时间", "发票类型", "发票抬头","税务登记号", "发票内容", "备注", "微信支付单号", "报名时间"]) + sheet1.row(0).concat(["姓名", "手机号","邮箱","单位名称", "职位","专业", "学号", '培训类型', '授课/研究领域' "支付方式","支付状态","支付时间", "发票类型", "发票抬头","税务登记号", "发票内容", "备注", "微信支付单号", "报名时间"]) count_row = 1 trainings.find_each do |t| sheet1[count_row, 0] = t.name @@ -4161,16 +4161,18 @@ end sheet1[count_row, 4] = t.position sheet1[count_row, 5] = t.major sheet1[count_row, 6] = t.student_id - sheet1[count_row, 7] = t.training_payinfo.try(:pay_type_str) - sheet1[count_row, 8] = t.training_payinfo.try(:pay_status_str) - sheet1[count_row, 9] = format_time t.training_payinfo.try(:pay_time) - sheet1[count_row, 10] = t.training_payinfo.try(:invoice_title).present? ? '需要' : '不需要' - sheet1[count_row, 11] = t.training_payinfo.try(:invoice_title) - sheet1[count_row, 12] = t.training_payinfo.try(:invoice_no) - sheet1[count_row, 13] = t.training_payinfo.try(:invoice_content) - sheet1[count_row, 14] = t.training_payinfo.try(:info) - sheet1[count_row, 15] = t.training_payinfo.try(:out_trade_no) - sheet1[count_row, 16] = format_time t.created_at + sheet1[count_row, 7] = t.training_category + sheet1[count_row, 8] = t.research_field + sheet1[count_row, 9] = t.training_payinfo.try(:pay_type_str) + sheet1[count_row, 10] = t.training_payinfo.try(:pay_status_str) + sheet1[count_row, 11] = format_time t.training_payinfo.try(:pay_time) + sheet1[count_row, 12] = t.training_payinfo.try(:invoice_title).present? ? '需要' : '不需要' + sheet1[count_row, 13] = t.training_payinfo.try(:invoice_title) + sheet1[count_row, 14] = t.training_payinfo.try(:invoice_no) + sheet1[count_row, 15] = t.training_payinfo.try(:invoice_content) + sheet1[count_row, 16] = t.training_payinfo.try(:info) + sheet1[count_row, 17] = t.training_payinfo.try(:out_trade_no) + sheet1[count_row, 18] = format_time t.created_at count_row += 1 end book.write xls_report diff --git a/app/controllers/trainings_controller.rb b/app/controllers/trainings_controller.rb index 40757ade..930efbb7 100644 --- a/app/controllers/trainings_controller.rb +++ b/app/controllers/trainings_controller.rb @@ -132,7 +132,9 @@ class TrainingsController < ApplicationController @training.training_category = params[:training_category] end @training.save! - redirect_to pay_training_path(id: @tag_id) + + redirect_to enroll_training_path(id: @tag_id) + # redirect_to pay_training_path(id: @tag_id) end diff --git a/app/views/trainings/enroll.html.erb b/app/views/trainings/enroll.html.erb index d6543a23..7cc642d2 100644 --- a/app/views/trainings/enroll.html.erb +++ b/app/views/trainings/enroll.html.erb @@ -148,40 +148,30 @@
  • 职称 - - - - - - - - - - - +
  • <% if @training_type == 3 %>

    培训类型

  • 大数据方向 - <%= radio_button_tag(:training_category, 'large_data', @training.training_category == 'large_data', id: 'type_1', class: 'magic-radio') %> + <%= radio_button_tag(:training_category, '大数据方向', @training.training_category == '大数据方向', id: 'type_1', class: 'magic-radio') %>
  • 人工智能方向 - <%= radio_button_tag(:training_category, 'ai', @training.training_category == 'ai', id: 'type_2', class: 'magic-radio') %> + <%= radio_button_tag(:training_category, '人工智能方向', @training.training_category == '人工智能方向', id: 'type_2', class: 'magic-radio') %>
  • 大数据+人工智能方向 - <%= radio_button_tag(:training_category, 'large_data_and_ai', @training.training_category == 'large_data_and_ai', id: 'type_3', class: 'magic-radio') %> + <%= radio_button_tag(:training_category, '大数据+人工智能方向', @training.training_category == '大数据+人工智能方向', id: 'type_3', class: 'magic-radio') %>