Browse Source

Merge pull request '修改排行榜的数量' (#225) from yystopf/forgeplus:hh_project_rank into feature_project_detail

tags/v4.0.0
yystopf 4 years ago
parent
commit
6efe9e7ec0
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/controllers/project_rank_controller.rb
  2. +1
    -1
      app/controllers/user_rank_controller.rb

+ 1
- 1
app/controllers/project_rank_controller.rb View File

@@ -2,7 +2,7 @@ class ProjectRankController < ApplicationController
# 根据时间获取热门项目
def index
$redis_cache.zunionstore("recent-days-project-rank", get_timeable_key_names)
@project_rank = $redis_cache.zrevrange("recent-days-project-rank", 0, 5, withscores: true)
@project_rank = $redis_cache.zrevrange("recent-days-project-rank", 0, 4, withscores: true)
rescue Exception => e
@project_rack = []
end


+ 1
- 1
app/controllers/user_rank_controller.rb View File

@@ -2,7 +2,7 @@ class UserRankController < ApplicationController
# 根据时间获取热门开发者
def index
$redis_cache.zunionstore("recent-days-user-rank", get_timeable_key_names)
@user_rank = $redis_cache.zrevrange("recent-days-user-rank", 0, 5, withscores: true)
@user_rank = $redis_cache.zrevrange("recent-days-user-rank", 0, 3, withscores: true)
rescue Exception => e
@user_rank = []
end


Loading…
Cancel
Save