2023-02-01 14:25:55 +08:00
|
|
|
class Admins::ProjectsRankController < Admins::BaseController
|
|
|
|
|
|
|
|
def index
|
|
|
|
@rank_date = rank_date
|
2023-02-01 14:50:12 +08:00
|
|
|
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
|