|
|
@ -826,7 +826,7 @@ class ManagementsController < ApplicationController
|
|
|
|
format.xls{
|
|
|
|
format.xls{
|
|
|
|
shixun_ids = @all_discusses.pluck(:dis_id).uniq
|
|
|
|
shixun_ids = @all_discusses.pluck(:dis_id).uniq
|
|
|
|
filename = "#{Time.now.strftime("%Y%m%d")}-实训反馈.xls"
|
|
|
|
filename = "#{Time.now.strftime("%Y%m%d")}-实训反馈.xls"
|
|
|
|
send_data(shixun_feedback_xls(shixun_ids), :type => "text/excel;charset=utf-8; header=present", :filename => filename_for_content_disposition(filename))
|
|
|
|
send_data(shixun_feedback_xls(shixun_ids, @beginTime, @endTime), :type => "text/excel;charset=utf-8; header=present", :filename => filename_for_content_disposition(filename))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -3345,7 +3345,7 @@ end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@users = User.where(:id => user_id).where("#{sql}").includes(:apply_actions, user_extensions: [:department, :school]).order("last_login_on desc")
|
|
|
|
@users = User.where(:id => user_id).where("#{sql}").includes(:apply_actions, user_extensions: [:department, :school]).order("last_login_on desc")
|
|
|
|
@xls_users = @users #导出excel用户
|
|
|
|
@xls_users = @users.reorder("created_on desc").limit(1000) #导出excel用户
|
|
|
|
@page = (params['page'] || 1).to_i
|
|
|
|
@page = (params['page'] || 1).to_i
|
|
|
|
@users_count = @users.count
|
|
|
|
@users_count = @users.count
|
|
|
|
@limit = 20
|
|
|
|
@limit = 20
|
|
|
@ -4250,7 +4250,7 @@ end
|
|
|
|
return sheet.rows
|
|
|
|
return sheet.rows
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def shixun_feedback_xls shixun_ids
|
|
|
|
def shixun_feedback_xls shixun_ids, beginTime, endTime
|
|
|
|
xls_report = StringIO.new
|
|
|
|
xls_report = StringIO.new
|
|
|
|
book = Spreadsheet::Workbook.new
|
|
|
|
book = Spreadsheet::Workbook.new
|
|
|
|
sheet1 = book.create_worksheet :name => "实训反馈"
|
|
|
|
sheet1 = book.create_worksheet :name => "实训反馈"
|
|
|
@ -4262,6 +4262,12 @@ end
|
|
|
|
"评论者单位", "评论时间", "社区导师是否已回复"])
|
|
|
|
"评论者单位", "评论时间", "社区导师是否已回复"])
|
|
|
|
shixuns.each_with_index do |shixun, i|
|
|
|
|
shixuns.each_with_index do |shixun, i|
|
|
|
|
discusses = shixun.discusses.where("user_id != ?", 1)
|
|
|
|
discusses = shixun.discusses.where("user_id != ?", 1)
|
|
|
|
|
|
|
|
if beginTime.present?
|
|
|
|
|
|
|
|
discusses = discusses.where("created_at >= '#{beginTime}'")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
if endTime.present?
|
|
|
|
|
|
|
|
discusses = discusses.where("created_at <= '#{endTime}'")
|
|
|
|
|
|
|
|
end
|
|
|
|
sheet1[count_row, 0] = i + 1
|
|
|
|
sheet1[count_row, 0] = i + 1
|
|
|
|
sheet1[count_row, 1] = shixun.identifier
|
|
|
|
sheet1[count_row, 1] = shixun.identifier
|
|
|
|
sheet1[count_row, 2] = shixun.name
|
|
|
|
sheet1[count_row, 2] = shixun.name
|
|
|
|