Merge remote-tracking branch 'origin/develop' into develop

dev_aliyun
杨树明 5 years ago
commit 5d41143ebb

@ -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>
<% 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> <div id="pieChart" style="height: 440px;width: 480px;"></div>
<% end %>
</div> </div>
</div> </div>
</div> </div>

@ -76,10 +76,10 @@
<% if team.teacher_id.present? %> <% if team.teacher_id.present? %>
<a href="<%= user_path(team.teacher) %>" class="fl" target="_blank" data-tip-down="指导老师:<%= team.teacher.show_name %>"><%= image_tag(url_to_avatar(team.teacher), :width => "26", :height => "26", :class => "radius fl mr4") %></a> <a href="<%= user_path(team.teacher) %>" class="fl" target="_blank" data-tip-down="指导老师:<%= team.teacher.show_name %>"><%= image_tag(url_to_avatar(team.teacher), :width => "26", :height => "26", :class => "radius fl mr4") %></a>
<% end %> <% end %>
<% team.team_members.where("user_id != #{team.teacher_id.present? ? team.teacher_id : '-1'}")[0, 9].each do |member| %> <% team.team_members.where("user_id != #{team.teacher_id.present? ? team.teacher_id : '-1'}")[0, 8].each do |member| %>
<%= link_to image_tag(url_to_avatar(member.user), :width => "20", :height => "20", :class => "radius fl mr5 mt3"), user_path(member.user), :title => member.user.show_name, :target => "_blank", :class => "fl", :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(member.user), :width => "20", :height => "20", :class => "radius fl mr5 mt3"), user_path(member.user), :title => member.user.show_name, :target => "_blank", :class => "fl", :alt => "用户头像" %>
<% end %> <% end %>
<% if team.team_members.size > 9 %> <% if team.team_members.size > 8 %>
<label class="mt5 team-p-s mt3">...</label> <label class="mt5 team-p-s mt3">...</label>
<% end %> <% end %>
</span> </span>

Loading…
Cancel
Save