Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
db28ecd883
|
@ -141,27 +141,26 @@ module WelcomeHelper
|
||||||
Course.active.visible.
|
Course.active.visible.
|
||||||
joins(:memberships).
|
joins(:memberships).
|
||||||
group('members.course_id').
|
group('members.course_id').
|
||||||
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum
|
reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum
|
||||||
|
|
||||||
else
|
else
|
||||||
if school_id.nil?
|
if school_id.nil?
|
||||||
Course.active.visible.
|
Course.active.visible.
|
||||||
joins(:memberships).
|
joins(:memberships).
|
||||||
where("#{Course.table_name}.school_id = ?", User.current.user_extensions.school.id).
|
where("#{Course.table_name}.school_id = ?", User.current.user_extensions.school.id).
|
||||||
group('members.course_id').
|
group('members.course_id').
|
||||||
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum
|
reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum
|
||||||
else
|
else
|
||||||
if school_id == "0"
|
if school_id == "0"
|
||||||
Course.active.visible.
|
Course.active.visible.
|
||||||
joins(:memberships).
|
joins(:memberships).
|
||||||
group('members.course_id').
|
group('members.course_id').
|
||||||
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum
|
reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum
|
||||||
else
|
else
|
||||||
Course.active.visible.
|
Course.active.visible.
|
||||||
joins(:memberships).
|
joins(:memberships).
|
||||||
where("#{Course.table_name}.school_id = ?", school_id).
|
where("#{Course.table_name}.school_id = ?", school_id).
|
||||||
group('members.course_id').
|
group('members.course_id').
|
||||||
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum
|
reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
||||||
<h3><strong>新开课程</strong></h3>
|
<h3><strong>新开课程</strong></h3>
|
||||||
<% if @school_id %>
|
<% if @school_id %>
|
||||||
<% school_course = find_miracle_course(10, 7, @school_id) %>
|
<% school_course = find_miracle_course(10,7, @school_id) %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%school_course=[]%>
|
<%school_course=[]%>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -138,6 +138,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="d-p-projectlist">
|
<ul class="d-p-projectlist">
|
||||||
<% school_course.map do |course| %>
|
<% school_course.map do |course| %>
|
||||||
|
<% if course.school%>
|
||||||
<li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s %>>
|
<li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s %>>
|
||||||
<div class='avatar'>
|
<div class='avatar'>
|
||||||
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
|
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
|
||||||
|
@ -167,6 +168,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<%end%>
|
||||||
<% end; reset_cycle %>
|
<% end; reset_cycle %>
|
||||||
<% if school_course.count < 9 %>
|
<% if school_course.count < 9 %>
|
||||||
<li>
|
<li>
|
||||||
|
|
Loading…
Reference in New Issue