From 9038f2758cd29c5be459dde959504f594ddbf08f Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Fri, 25 Apr 2014 10:10:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=B0=86=E6=97=A7=E7=9A=84?= =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E4=BF=A1=E6=81=AF=E5=92=8C=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E7=9A=84=E9=A1=B9=E7=9B=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=88=B0=E6=96=B0=E7=9A=84=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=95=B0=E6=8D=AE=E8=A1=A8=E5=90=8E=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E8=B0=83=E6=95=B4=E7=AB=9E=E8=B5=9B=E5=AD=90=E7=AB=99?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=9C=80=E6=96=B0=E7=83=AD=E9=97=A8=E7=AB=9E?= =?UTF-8?q?=E8=B5=9B=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/welcome_helper.rb | 16 ++++++++-------- app/views/welcome/contest.html.erb | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 9970ee9c6..e25b4f3f6 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -98,14 +98,14 @@ module WelcomeHelper end def find_all_hot_contest limit=10 - # Contest.reorder("created_on DESC").all.take limit - mix_bid = [] - mix_bid += Contest.reorder("created_on DESC").take(limit).to_a - mix_bid += Bid.visible.where('reward_type = ?', 2).reorder('bids.created_on desc').take(limit).to_a - mix_bid.sort do |older, newer| - newer.created_on - older.created_on - end - mix_bid.take limit + Contest.reorder("created_on DESC").all.take limit + # mix_bid = [] + # mix_bid += Contest.reorder("created_on DESC").take(limit).to_a + # mix_bid += Bid.visible.where('reward_type = ?', 2).reorder('bids.created_on desc').take(limit).to_a + # mix_bid.sort do |older, newer| + # newer.created_on - older.created_on + # end + # mix_bid.take limit end def find_all_hot_softapplication limit=10 diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 6ef2b4796..d8dc45873 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -138,7 +138,7 @@ <%= link_to "更多>>", {:controller => 'contests', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %>
- <% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[6]) %> + <% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
  • @@ -146,7 +146,8 @@
    - <%= link_to(contest.name, contest.event_url, :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> + + <%= link_to(contest.name, show_contest_contest_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>