学院统计页的调整

dev_aliyun
cxt 5 years ago
parent a95e3066ba
commit 4cb4280c25

@ -67,7 +67,7 @@ class CollegesController < ApplicationController
user_extensions.`school_id`=#{@school.id}) and work_status between 1 and 2 and myshixun_id !=0").first.try(:sw_count) user_extensions.`school_id`=#{@school.id}) and work_status between 1 and 2 and myshixun_id !=0").first.try(:sw_count)
@teachers = User.find_by_sql("SELECT users.id, users.login, users.lastname, users.firstname, users.nickname, IFNULL((SELECT count(shixuns.id) FROM shixuns where shixuns.user_id =users.id group by shixuns.user_id), 0) AS publish_shixun_count, @teachers = User.find_by_sql("SELECT users.id, users.login, users.lastname, users.firstname, users.nickname, IFNULL((SELECT count(shixuns.id) FROM shixuns where shixuns.user_id =users.id group by shixuns.user_id), 0) AS publish_shixun_count,
(SELECT count(c.id) FROM courses c, members m, member_roles mr WHERE m.course_id = c.id AND m.id=mr.member_id AND mr.role_id in (3,7,9) AND m.user_id=users.id AND c.is_delete = 0) as course_count (SELECT count(c.id) FROM courses c, members m, member_roles mr WHERE c.id != 1309 and m.course_id = c.id AND m.id=mr.member_id AND mr.role_id in (3,7,9) AND m.user_id=users.id AND c.is_delete = 0) as course_count
FROM `users`, user_extensions ue where users.id=ue.user_id and ue.identity=0 and ue.school_id=#{@school.id} ORDER BY publish_shixun_count desc, course_count desc, id desc LIMIT 10") FROM `users`, user_extensions ue where users.id=ue.user_id and ue.identity=0 and ue.school_id=#{@school.id} ORDER BY publish_shixun_count desc, course_count desc, id desc LIMIT 10")
# ).order("publish_shixun_count desc, experience desc").limit(10) # ).order("publish_shixun_count desc, experience desc").limit(10)
@teachers = @teachers =

@ -14,4 +14,13 @@ module CollegesHelper
end end
type type
end end
def course_managers teachers
str = ""
teachers.each_with_index do |teacher, index|
str += "" if index > 0
str += teacher.user.try(:show_real_name)
end
str
end
end end

@ -2,7 +2,7 @@
<table class="edu-pop-table head-color bor-top-greyE" cellspacing="0" cellpadding="0"> <table class="edu-pop-table head-color bor-top-greyE" cellspacing="0" cellpadding="0">
<thead> <thead>
<th width="20%" class="pl20 edu-txt-left">名称</th> <th width="20%" class="pl20 edu-txt-left">名称</th>
<th class="pl20 edu-txt-left">创建教师</th> <th class="pl20 edu-txt-left">管理教师</th>
<th>评测次数</th> <th>评测次数</th>
<th>学生</th> <th>学生</th>
<th>实训作业</th> <th>实训作业</th>
@ -16,7 +16,9 @@
<% @courses.each do |course| %> <% @courses.each do |course| %>
<tr> <tr>
<td><a href="<%= course_path(course) %>" target="_blank" class="task-hide pl20 edu-txt-left" style="max-width: 220px"><%= course.name %></a></td> <td><a href="<%= course_path(course) %>" target="_blank" class="task-hide pl20 edu-txt-left" style="max-width: 220px"><%= course.name %></a></td>
<td><a href="<%= user_path(course.tea_id) %>" class="pl20 edu-txt-left" target="_blank"><%= course.username %></a></td> <td class="task-hide" style="max-width: 220px" title="<%= course_managers course.teachers %>">
<%= course_managers course.teachers %>
</td>
<td class="edu-txt-center"><%= course.evaluating_count %></td> <td class="edu-txt-center"><%= course.evaluating_count %></td>
<td class="edu-txt-center"><%= course.student_count.to_i %></td> <td class="edu-txt-center"><%= course.student_count.to_i %></td>
<td class="edu-txt-center"><%= course.hcm_count.to_i %></td> <td class="edu-txt-center"><%= course.hcm_count.to_i %></td>

@ -100,7 +100,12 @@
<div class="fl width40"> <div class="fl width40">
<div class="online_status static_shadow"> <div class="online_status static_shadow">
<p class="font-24 padding30-20">在线实训情况</p> <p class="font-24 padding30-20">在线实训情况</p>
<div id="pieChart" style="height: 440px;width: 480px;"></div> <% if @shixun_tags_name.size == 0 %>
<%= render :partial => 'welcome/no_data' %>
<div id="pieChart"></div>
<% else %>
<div id="pieChart" style="height: 440px;width: 480px;"></div>
<% end %>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save