Browse Source

修复

pull/342/head
yystopf 3 years ago
parent
commit
2d00200036
2 changed files with 4 additions and 1 deletions
  1. +1
    -0
      app/queries/blockchain/balance_query.rb
  2. +3
    -1
      app/views/users/blockchain_balance.json.jbuilder

+ 1
- 0
app/queries/blockchain/balance_query.rb View File

@@ -14,6 +14,7 @@ class Blockchain::BalanceQuery < ApplicationQuery
token_list.each do |t|
project = Project.find_by(id: t['token_name'].to_i)
if project.nil?
result_list << {project: nil, balance: t['balance']}
next
end
owner = User.find_by(id: project.user_id)


+ 3
- 1
app/views/users/blockchain_balance.json.jbuilder View File

@@ -1,5 +1,7 @@
json.total_count @total_count
json.projects @projects.each do |p|
json.partial! 'projects/detail', locals: { project: p[:project] }
if p[:project].present?
json.partial! 'projects/detail', locals: { project: p[:project] }
end
json.balance p[:balance]
end

Loading…
Cancel
Save