fix bug of blockchain_balance_one_project function
This commit is contained in:
parent
2f6c568688
commit
015d221ccf
|
@ -91,7 +91,7 @@ class UsersController < ApplicationController
|
|||
(count_user * 1.0 / (count_all + 0.000000001)).round(5)
|
||||
end
|
||||
|
||||
if @project.use_blockchain == true or @project.use_blockchain == 1
|
||||
if @project['use_blockchain'] == true or @project['use_blockchain'] == 1
|
||||
balance_user = Blockchain::BalanceQueryOneProject.call({"user_id": user_id, "project_id": project_id})[:balance]
|
||||
balance_all = Blockchain::RepoBasicInfo.call({"project_id": project_id})["cur_supply"]
|
||||
scores = {
|
||||
|
@ -439,7 +439,7 @@ class UsersController < ApplicationController
|
|||
if owner.nil?
|
||||
normal_status(-1, "创建者无法找到")
|
||||
else
|
||||
p = Project.find_by(user_id: owner.id, name: params['project_name'])
|
||||
p = Project.find_by(user_id: owner.id, identifier: params['project_identifier'])
|
||||
results = Blockchain::BalanceQueryOneProject.call({"user_id": params['user_id'].to_i, "project_id": p.id.to_i})
|
||||
render json: { status: results[:status], balance: results[:balance]}
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue