|
|
@ -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,7 +100,6 @@ 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]}%'")
|
|
|
@ -117,9 +116,7 @@ class ManagementsController < ApplicationController
|
|
|
|
@page = params[:page] || 1
|
|
|
|
@page = params[:page] || 1
|
|
|
|
@all_trainings = @trainings.reorder("trainings.created_at desc")
|
|
|
|
@all_trainings = @trainings.reorder("trainings.created_at desc")
|
|
|
|
@trainings = paginateHelper @trainings.reorder("trainings.created_at desc"), 50
|
|
|
|
@trainings = paginateHelper @trainings.reorder("trainings.created_at desc"), 50
|
|
|
|
else
|
|
|
|
|
|
|
|
render_403
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
respond_to do |format|
|
|
|
|
format.js
|
|
|
|
format.js
|
|
|
|
format.html
|
|
|
|
format.html
|
|
|
|