From 7ead12dba6f8001c4f5771c05a49f4935f2f7442 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 19 May 2014 10:00:24 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E8=B7=AF=E7=94=B1=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=202.=E4=BF=AE=E6=94=B9=E5=BD=93=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=AD=A6=E6=A0=A1=E8=AF=BE=E7=A8=8B=E6=95=B0=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E5=B0=91=E4=BA=8E8=E4=B8=AA=E6=97=B6=EF=BC=8C=E6=8E=A8?= =?UTF-8?q?=E8=8D=909-=E5=BD=93=E5=89=8D=E5=AD=A6=E6=A0=A1=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E6=95=B0=E9=87=8F=E9=97=A8=E6=9C=80=E5=A5=BD=E7=9A=84?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=BB=99=E7=94=A8=E6=88=B7=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E4=B8=94=E6=8E=92=E9=99=A4=E5=BD=93=E5=89=8D=E5=AD=A6=E6=A0=A1?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/welcome_helper.rb | 5 ++- app/views/welcome/course.html.erb | 61 +++++++++++++++++++++++++++++-- config/routes.rb | 10 +++-- 3 files changed, 66 insertions(+), 10 deletions(-) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index e05f789a9..2985de48b 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -154,10 +154,11 @@ module WelcomeHelper sort_course_by_hot limit end - def find_all_new_hot_course limit = 9 + def find_all_new_hot_course limit = 9 ,school_id #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}%'", 1).order("course_ac_para DESC").limit(limit).all + 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 end def find_all_hot_bid diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 8b1a9d9ee..6dd490ff0 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -73,7 +73,8 @@
+ 该学校开设课程较少,您可以查看其他学校课程 +
+