Add lndhub info to admin user page
This commit is contained in:
@@ -10,6 +10,18 @@ class LndhubUser < LndhubBase
|
||||
foreign_key: "login"
|
||||
|
||||
def balance
|
||||
accounts.current.first.ledgers.sum("account_ledgers.amount")
|
||||
accounts.current.first.ledgers.sum("account_ledgers.amount").to_i.abs
|
||||
end
|
||||
|
||||
def sum_outgoing
|
||||
accounts.outgoing.first.ledgers.sum("account_ledgers.amount").to_i.abs
|
||||
end
|
||||
|
||||
def sum_incoming
|
||||
accounts.incoming.first.ledgers.sum("account_ledgers.amount").to_i.abs
|
||||
end
|
||||
|
||||
def sum_fees
|
||||
accounts.fees.first.ledgers.sum("account_ledgers.amount").to_i.abs
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user