diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 2985de48..33001021 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -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