dev_new_shixunsrepository
daiao 5 years ago
parent ce037ab6b1
commit 2c99c6012b

@ -5,7 +5,7 @@ class SubjectsController < ApplicationController
before_action :find_subject, except: [:index, :create, :new, :append_to_stage, :add_shixun_to_stage]
before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish,
:search_members, :add_subject_members, :statistics, :shixun_report, :school_report,
:up_member_position, :down_member_position, :update_team_title]
:up_member_position, :down_member_position, :update_team_title, :statistics_info]
before_action :require_admin, only: [:copy_subject]
before_action :shixun_marker, only: [:add_shixun_to_stage]
@ -456,7 +456,7 @@ class SubjectsController < ApplicationController
end
end
def statistics_new
def statistics_info
# data = Subjects::DataStatisticService.new(@subject)
# Rails.logger.info("study_count: #{data.study_count}")
# Rails.logger.info("course_study_count: #{ data.course_study_count}")
@ -470,9 +470,19 @@ class SubjectsController < ApplicationController
# data_2 = Subjects::ShixunUsedInfoService.call(@subject)
# Rails.logger.info("study_count: #{data_2}")
data_3 = Subjects::UserUsedInfoService.call(@subject)
Rails.logger.info("study_count: #{data_3}")
render_ok()
# data_3 = Subjects::UserUsedInfoService.call(@subject)
# Rails.logger.info("study_count: #{data_3}")
@data =
if params[:type] == "shixun_info"
@subject.subject_shixun_infos
elsif params[:type] == "user_info"
@subject.subject_user_infos
else
@subject.subject_course_records
end
@data = paginate custom_sort(@data, params[:sort_by], params[:sort_direction])
end
def shixun_report

@ -394,7 +394,7 @@ Rails.application.routes.draw do
get 'cancel_publish'
get 'cancel_has_publish'
get 'statistics'
get 'statistics_new'
get 'statistics_info'
get 'shixun_report'
get 'school_report'
post 'update_attr'

Loading…
Cancel
Save