From a274fa913d9b93d8af6e70c53410b715410cdb23 Mon Sep 17 00:00:00 2001 From: yystopf Date: Wed, 4 Jan 2023 11:38:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=A6=9C=E7=BC=93=E5=AD=98=E9=94=AE=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E6=97=B6=E9=97=B4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/project_rank_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/project_rank_controller.rb b/app/controllers/project_rank_controller.rb index 8584d070f..5cea074fb 100644 --- a/app/controllers/project_rank_controller.rb +++ b/app/controllers/project_rank_controller.rb @@ -1,10 +1,10 @@ class ProjectRankController < ApplicationController # 根据时间获取热门项目 def index - $redis_cache.zunionstore("recent-days-project-rank", get_timeable_key_names) + $redis_cache.zunionstore("recent-days-project-rank-#{time}", get_timeable_key_names) deleted_data = $redis_cache.smembers("v2-project-rank-deleted") - $redis_cache.zrem("recent-days-project-rank", deleted_data) unless deleted_data.blank? - @project_rank = $redis_cache.zrevrange("recent-days-project-rank", 0, 9, withscores: true) + $redis_cache.zrem("recent-days-project-rank-#{time}", deleted_data) unless deleted_data.blank? + @project_rank = $redis_cache.zrevrange("recent-days-project-rank-#{time}", 0, 9, withscores: true) rescue Exception => e @project_rank = [] end