fixed: user rank project owner changed remove rank

This commit is contained in:
xxq250 2023-07-04 16:07:19 +08:00
parent 2b03ccc67c
commit 1b68e7c9d5
1 changed files with 11 additions and 5 deletions

View File

@ -25,11 +25,17 @@ if popular_project.blank?
json.project nil
else
popular_project_common = $redis_cache.hgetall("v2-project-common:#{popular_project[0]}")
json.project do
json.id popular_project[0]
json.name popular_project_common["name"]
json.identifier popular_project_common["identifier"]
json.description popular_project_common["description"]
if popular_project_common["owner_id"].to_s == item[0].to_s
json.project do
json.id popular_project[0]
json.name popular_project_common["name"]
json.identifier popular_project_common["identifier"]
json.description popular_project_common["description"]
end
else
# owner changed remove rank
$redis_cache.zrem("v2-user-project-rank:#{item[0]}", popular_project[0])
json.project nil
end
end