diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb
index cc4e6c9a..93d2df8e 100644
--- a/app/controllers/colleges_controller.rb
+++ b/app/controllers/colleges_controller.rb
@@ -258,7 +258,7 @@ class CollegesController < ApplicationController
unless (User.current.admin? || User.current.business? ||
(@department.present? && DepartmentMember.where(:user_id => User.current.id, :department_id => @department.id).first.present?) ||
(User.current.user_extensions.try(:school_id) == @school.id && User.current.user_extensions.try(:identity) == 0) ||
- (@school.try(:customer_id) && User.current.try(:partner).try(:customer_ids) && User.current.try(:partner).try(:customer_ids).include?(@school.try(:customer_id))))
+ (@school.try(:customer_id) && User.current.try(:partner).try(:customer_ids) && User.current.try(:partner).try(:customer_ids).include?(@school.try(:customer_id))))
render_403
end
end
diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb
index d04b4f23..884e32a8 100644
--- a/app/controllers/managements_controller.rb
+++ b/app/controllers/managements_controller.rb
@@ -39,7 +39,7 @@ class ManagementsController < ApplicationController
format.html
format.xls{
time = Time.now.strftime("%Y%m%d")
- filename = "实训课程体系#{time}.xls"
+ filename = "引流情况#{time}.xls"
send_data(user_agents_export(), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end
@@ -4389,10 +4389,11 @@ end
user_agents = UserAgent.where("user_agents.key is not null").pluck(:key).uniq
user_agents.each_with_index do |agent, index|
user = User.find_by_login(agent)
+ next if user.blank?
# 代理用户
agents = UserAgent.where(key: agent)
agents_count = agents.count
- competion_users = agents.where(agent_type: UserAgent::USER_COMPETITION).pluck(:ip)
+ competion_users = agents.where(action_status: 2).pluck(:ip)
rank_user_id = UserActions.where(ip: competion_users).pluck(:user_id).uniq
team_ids = TeamMember.where(user_id: rank_user_id).pluck(:competition_team_id).uniq
sheet1[count_row, 0] = index + 1
diff --git a/app/views/colleges/statistics.html.erb b/app/views/colleges/statistics.html.erb
index 8df81fcb..cc7ff4e6 100644
--- a/app/views/colleges/statistics.html.erb
+++ b/app/views/colleges/statistics.html.erb
@@ -139,15 +139,15 @@
})
});
- $.get('<%= shixun_time_college_path(@school) %>', function(data){
+ $.get('<%= shixun_time_college_path(@department.identifier) %>', function(data){
$('.shixun-time').html("" + data.shixun_time + "天");
});
- $.get('<%= shixun_report_count_college_path(@school) %>', function(data){
+ $.get('<%= shixun_report_count_college_path(@department.identifier) %>', function(data){
$('.shixun-report-count').html("" + data.shixun_report_count + "个");
});
// 教师排名
- $.ajax({ url: '<%= teachers_college_path(@school) %>', method: 'GET', dataType: 'script' })
+ $.ajax({ url: '<%= teachers_college_path(@department.identifier) %>', method: 'GET', dataType: 'script' })
$(".count_student_test a").click(function(){
$(".count_student_test a").removeClass("active");
@@ -155,7 +155,7 @@
});
//初始化饼状图
- $.get('<%= shixun_chart_data_college_path(@school) %>', function(data){
+ $.get('<%= shixun_chart_data_college_path(@department.identifier) %>', function(data){
$('.pie-chart-loading').hide();
if (data.names.length > 0) {
$('.online_status .edu-tab-con-box').hide();
@@ -166,7 +166,7 @@
}
});
- $.get('<%= course_statistics_college_path(@school) %>');
+ $.get('<%= course_statistics_college_path(@department.identifier) %>');
});
function InitPieChart(names, data){
var Color = ['#49A9EE', '#FFD86E', '#98D87D', '#8996E6', '#F3857B', '#B97BF3','#4DE8B4','#F37BDB','#566EFF','#FF961A'];