Merge branch 'dev_aliyun' into educoder

dev_aliyun
daiao 5 years ago
commit 290ac0e84b

@ -5,7 +5,7 @@ class ManagementsController < ApplicationController
:editmd_template, :subject_level_system, :subject_setting_list, :editmd_template, :subject_level_system, :subject_setting_list,
:shixun_authorization, :ec_template, :codemirror_template, :shixun_authorization, :ec_template, :codemirror_template,
:course_guide_template, :shixun_quality_score, :tech_system, :update_notice, :setting_banner, :course_guide_template, :shixun_quality_score, :tech_system, :update_notice, :setting_banner,
:training_2018, :create_standard] :create_standard]
layout 'base_management' layout 'base_management'
include ManagementsHelper include ManagementsHelper
include SortHelper include SortHelper
@ -100,26 +100,23 @@ class ManagementsController < ApplicationController
@pay_type = params[:pay_type] @pay_type = params[:pay_type]
@page = params[:page] || 1 @page = params[:page] || 1
@status = params[:status] @status = params[:status]
if User.current.admin? @trainings = Training.includes(:training_payinfo)
@trainings = Training.includes(:training_payinfo) if params[:search] && params[:search].strip != ""
if params[:search] && params[:search].strip != "" @trainings = @trainings.where("trainings.name like '%#{params[:search]}%'")
@trainings = @trainings.where("trainings.name like '%#{params[:search]}%'")
end
if params[:training_type] && params[:training_type].to_i != -1
@trainings = @trainings.where("training_type = #{params[:training_type]}")
end
if params[:pay_type] && params[:pay_type].to_i != -1
@trainings = @trainings.where("training_payinfos.pay_type = #{params[:pay_type]}")
end
if params[:status] && params[:status].to_i != -1
@trainings = @trainings.where("training_payinfos.status = #{params[:status]}")
end
@page = params[:page] || 1
@all_trainings = @trainings.reorder("trainings.created_at desc")
@trainings = paginateHelper @trainings.reorder("trainings.created_at desc"), 50
else
render_403
end end
if params[:training_type] && params[:training_type].to_i != -1
@trainings = @trainings.where("training_type = #{params[:training_type]}")
end
if params[:pay_type] && params[:pay_type].to_i != -1
@trainings = @trainings.where("training_payinfos.pay_type = #{params[:pay_type]}")
end
if params[:status] && params[:status].to_i != -1
@trainings = @trainings.where("training_payinfos.status = #{params[:status]}")
end
@page = params[:page] || 1
@all_trainings = @trainings.reorder("trainings.created_at desc")
@trainings = paginateHelper @trainings.reorder("trainings.created_at desc"), 50
respond_to do |format| respond_to do |format|
format.js format.js
format.html format.html
@ -878,7 +875,7 @@ class ManagementsController < ApplicationController
def evaluate_simple def evaluate_simple
page = params[:page] page = params[:page]
@recodes = EvaluateRecord.where("created_at < ?", Time.now).reorder("consume_time desc") @recodes = EvaluateRecord.where("created_at > ?", Time.now - 1.days).reorder("consume_time desc")
@recodes_count = @recodes.size @recodes_count = @recodes.size
@record_pages = Paginator.new @recodes_count, 20, page || 1 @record_pages = Paginator.new @recodes_count, 20, page || 1
@offset ||= @record_pages.offset @offset ||= @record_pages.offset

@ -90,7 +90,7 @@
<li class="lineh-25 color-grey-6 font-18 mb20">温馨提示</li> <li class="lineh-25 color-grey-6 font-18 mb20">温馨提示</li>
<ul class="font-16"> <ul class="font-16">
<li>1.请勿上传已设置加密口令的文档资源;</li> <li>1.请勿上传已设置加密口令的文档资源;</li>
<li>2.可以上传符合教学案例标准的文档资料,如<a class="color-blue" target="_blank" href="https://www.educoder.net/boards/5909/topics/34799">案例入库标准</a>、<a target="_blank" class="color-blue" href="https://www.educoder.net/boards/5909/topics/34798">案例使用说明书</a>以及其他资料等上传支持的文件最大容量100MB</li> <li>2.可以上传符合教学案例标准的文档资料,如<a class="color-blue" target="_blank" href="https://www.educoder.net/courses/1309/boards/5909/messages/34799">案例入库标准</a>、<a target="_blank" class="color-blue" href="https://www.educoder.net/courses/1309/boards/5909/messages/34798">案例使用说明书</a>以及其他资料等上传支持的文件最大容量100MB</li>
<li>3.请确保上传内容无侵权或违反国家关于互联网政策的不良行为;</li> <li>3.请确保上传内容无侵权或违反国家关于互联网政策的不良行为;</li>
<li>4.请使用ChromeFirefoxSafariIE11及以上版本浏览器</li> <li>4.请使用ChromeFirefoxSafariIE11及以上版本浏览器</li>
</ul> </ul>

@ -0,0 +1,5 @@
class AddExecTimeToEvaluateRecords < ActiveRecord::Migration
def change
add_column :evaluate_records, :exec_time, :integer
end
end
Loading…
Cancel
Save