From 14a468066fe829c2421abcdbf8600a7ecb692636 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 19 May 2014 16:53:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=BC=80=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=EF=BC=8CSQL=E6=B2=A1=E6=9C=89=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=9A=84school=5Fid=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/welcome_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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