修复打开首页,SQL没有默认的school_id的问题

This commit is contained in:
sw 2014-05-19 16:53:38 +08:00
parent 7ead12dba6
commit 14a468066f
1 changed files with 2 additions and 2 deletions

View File

@ -154,11 +154,11 @@ module WelcomeHelper
sort_course_by_hot limit
end
def find_all_new_hot_course limit = 9 ,school_id
def find_all_new_hot_course limit = 9 ,school_id = 0
#sort_project_by_hot_rails 1, 'course_ac_para DESC', limit
time_now = Time.new.strftime("%Y");
Project.visible.joins(:project_status).where("#{Project.table_name}.project_type = ? and #{Project.table_name}.created_on like '%#{time_now}%' and #{Project.table_name}.identifier not in
(select extra from courses where school_id = #{school_id})", 1).order("course_ac_para DESC").limit(limit).all
(select extra from courses where school_id = ?)", 1,school_id).order("course_ac_para DESC").limit(limit).all
end
def find_all_hot_bid