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 @@
作业<%=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 %>