forgeplus/app/controllers/admins/projects_rank_controller.rb

16 lines
450 B
Ruby
Raw Normal View History

2023-02-01 14:25:55 +08:00
class Admins::ProjectsRankController < Admins::BaseController
def index
@rank_date = rank_date
deleted_data = $redis_cache.smembers("v2-project-rank-deleted")
$redis_cache.zrem("v2-project-rank-#{rank_date}", deleted_data) unless deleted_data.blank?
2023-02-01 14:25:55 +08:00
@date_rank = $redis_cache.zrevrange("v2-project-rank-#{rank_date}", 0, -1, withscores: true)
end
private
def rank_date
params.fetch(:date, Date.today.to_s)
end
end