diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 6e495cdf..d946c12b 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -5,7 +5,7 @@ class ManagementsController < ApplicationController :editmd_template, :subject_level_system, :subject_setting_list, :shixun_authorization, :ec_template, :codemirror_template, :course_guide_template, :shixun_quality_score, :tech_system, :update_notice, :setting_banner, - :training_2018, :create_standard] + :create_standard] layout 'base_management' include ManagementsHelper include SortHelper @@ -100,26 +100,23 @@ class ManagementsController < ApplicationController @pay_type = params[:pay_type] @page = params[:page] || 1 @status = params[:status] - if User.current.admin? - @trainings = Training.includes(:training_payinfo) - if params[:search] && params[:search].strip != "" - @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 + @trainings = Training.includes(:training_payinfo) + if params[:search] && params[:search].strip != "" + @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 + respond_to do |format| format.js format.html @@ -878,7 +875,7 @@ class ManagementsController < ApplicationController def evaluate_simple 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 @record_pages = Paginator.new @recodes_count, 20, page || 1 @offset ||= @record_pages.offset diff --git a/app/views/libraries/_form.html.erb b/app/views/libraries/_form.html.erb index c5bb2ecd..e5878176 100644 --- a/app/views/libraries/_form.html.erb +++ b/app/views/libraries/_form.html.erb @@ -90,7 +90,7 @@