Browse Source

fixed: user rank project owner changed remove rank

pull/338/head
xxq250 3 years ago
parent
commit
bcab75e5d1
1 changed files with 11 additions and 5 deletions
  1. +11
    -5
      app/views/user_rank/_detail.json.jbuilder

+ 11
- 5
app/views/user_rank/_detail.json.jbuilder 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



Loading…
Cancel
Save