修改首页项目显示为按活跃度排名的前10个项目

This commit is contained in:
sw 2014-06-23 09:42:08 +08:00
parent 339b5b0296
commit 0dce86d47e
1 changed files with 5 additions and 4 deletions

View File

@ -158,10 +158,11 @@ module WelcomeHelper
end
def find_miracle_project(sum, max_rate)
max = sum*(max_rate.to_f/10)
c1 = find_new_project(sum).to_a.dup
c2 = find_all_hot_project(sum).to_a.dup
(c2.take(sum-max)+c1.take(max)).take(sum)
#max = sum*(max_rate.to_f/10)
#c1 = find_new_project(sum).to_a.dup
#c2 = find_all_hot_project(sum).to_a.dup
#(c2.take(sum-max)+c1.take(max)).take(sum)
find_all_hot_project(sum).to_a.dup
end
def find_new_course limit=15