修复未登录时进入指定学校课程列表显示却是国防科大课程列表的BUG

This commit is contained in:
sw 2015-03-03 17:35:46 +08:00
parent 7b5eb9db8b
commit 9233213127
2 changed files with 5 additions and 4 deletions

View File

@ -84,7 +84,7 @@ class WelcomeController < ApplicationController
def course def course
@course_page = FirstPage.find_by_page_type('course') @course_page = FirstPage.find_by_page_type('course')
@school_id = params[:school_id] || User.current.user_extensions.school.try(:id) @school_id = params[:school_id] || User.current.user_extensions.school.try(:id) || 117
@logoLink ||= logolink() @logoLink ||= logolink()
##3-8月份为查找春季课程9-2月份为查找秋季课程 ##3-8月份为查找春季课程9-2月份为查找秋季课程

View File

@ -108,12 +108,13 @@
</span> </span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% if User.current.logged? %> <%# if User.current.logged? %>
<li> <li>
<%= render :partial => 'no_course_title', :locals => {:course_title => l(:label_school_no_course)} %> <%= render :partial => 'no_course_title', :locals => {:course_title => l(:label_school_no_course)} %>
</li> </li>
<% end %> <%# end %>
<% User.current.logged? ? course_count = 9 : course_count = 10 %> <%# User.current.logged? ? course_count = 9 : course_count = 10 %>
<% course_count = 9 %>
<% all_new_hot_course = find_all_new_hot_course(course_count, @school_id, year_now, course_term)%> <% all_new_hot_course = find_all_new_hot_course(course_count, @school_id, year_now, course_term)%>
<% while all_new_hot_course.count < course_count%> <% while all_new_hot_course.count < course_count%>
<% if course_term == "春季学期" <% if course_term == "春季学期"