From c0515b9e7f98f3bc6014631d5ac957bc785911ab Mon Sep 17 00:00:00 2001 From: nigel007 <609441862@qq.com> Date: Thu, 13 May 2021 23:22:36 +0800 Subject: [PATCH] change bug in balanceQuery --- app/queries/blockchain/balance_query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/queries/blockchain/balance_query.rb b/app/queries/blockchain/balance_query.rb index 1c00152ed..ec765b997 100644 --- a/app/queries/blockchain/balance_query.rb +++ b/app/queries/blockchain/balance_query.rb @@ -12,8 +12,8 @@ class Blockchain::BalanceQuery < ApplicationQuery token_list = find_repo_with_token(params["user_id"]) result_list = [] token_list.each do |t| - owner = User.find_by(id: t['username'].to_i) project = Project.find_by(id: t['token_name'].to_i) + owner = User.find_by(id: project.user_id) if owner.nil? || project.nil? else balance = t['balance']