From 48d5b89338730dfddef90e4a078f5de1f675806d Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jul 2016 18:26:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8E=A8=E8=8D=90=E4=B8=BA0?= =?UTF-8?q?=E7=9A=84=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_recommendation.html.erb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb index ea129577b..ece60cdd1 100644 --- a/app/views/courses/_recommendation.html.erb +++ b/app/views/courses/_recommendation.html.erb @@ -5,8 +5,15 @@
  • <%= i+1 %> <%=link_to e_course.name, course_path(e_course.id), :class => "sy_class_ltitle fl mb10" %> -

    作业<%=e_course.homework_commons.where("publish_time <= '#{Date.today}'").count %> - 资源<%=visable_attachemnts_incourse(e_course).count %> +

    + <% homework_count = e_course.homework_commons.where("publish_time <= '#{Date.today}'").count %> + <% if homework_count > 0 %> + 作业<%=homework_count %> + <% end %> + <% file_count = visable_attachemnts_incourse(e_course).count %> + <% if file_count > 0 %> + 资源<%=file_count %> + <% end %>

  • <% end %>