Commit c11610c7 authored by Kalinka's avatar Kalinka

Fix Queries + Cosmetic stuff

parent 5ae4f6cf
......@@ -18,6 +18,9 @@ class AccountController extends AbstractController
a.name,
a.creation_height AS first_block,
a.height AS last_block,
getTransactionCountByAccountId(a.id) AS tx_total_count,
getIncomingTransactionCountByAccountId(a.id) AS tx_in_count,
getOutgoingTransactionCountByAccountId(a.id) AS tx_out_count,
FORMAT(a.forged_balance/ 100000000, 2) as forged_balance,
(( SELECT SUM(b.total_fee) FROM block b WHERE generator_id = a.id)/ 100000000) AS pool_balance_fee,
( SELECT SUM(FLOOR(pow(0.95,FLOOR(b.height/10800))*10000)) FROM block b WHERE b.generator_id = a.id) AS pool_balance_forged,
......@@ -35,11 +38,8 @@ class AccountController extends AbstractController
FORMAT(( SELECT SUM(t.fee) FROM transaction t WHERE t.sender_id = a.id)/ 100000000, 2) AS fees_paid,
FORMAT(( SELECT SUM(t.amount) FROM transaction t WHERE t.sender_id = a.id)/ 100000000, 2) AS burst_sent,
( SELECT COUNT(t.amount) FROM transaction t WHERE t.sender_id = a.id) AS count_sent,
( SELECT COUNT(t.amount) FROM transaction t WHERE t.recipient_id = a.id) AS tx_count,
( SELECT SUM(t.amount) FROM transaction t WHERE t.recipient_id = a.id) AS burst_recieved,
( SELECT SUM(mo.amount) FROM mo WHERE mo.recipient_id = a.id) AS mo_recieved,
( SELECT COUNT(mo.amount) FROM mo WHERE mo.recipient_id = a.id) AS mo_count,
( SELECT COUNT(mosr.db_id) FROM mosr WHERE mosr.recipient_id = a.id) AS mos_count,
( SELECT SUM(moss.amount)
FROM (
SELECT most.amount / mos.recipient_count as amount
......
......@@ -138,7 +138,7 @@ class TransactionController extends AbstractController
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(mo.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(t.amount / 100000000, 2) AS amount,
FORMAT(mo.amount / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type,
CAST(t.block_id AS UNSIGNED) as block_id,
......
......@@ -9,17 +9,17 @@
<tr><th>Account</th><td>{{ account.id | toRSAddress }}</td></tr>
<tr><th>Public Key</th><td>{{ account.public_key | str2bin }}</td></tr>
<tr><th>Name</th><td>{{ account.name }}</td></tr>
<tr><th>Balance</th><td>{{ account.balance }} Burst </td></tr>
<tr><th>Balance</th><td>{{ account.balance }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Recieved</th>
<td>
{{ ((account.burst_recieved + account.mo_recieved + account.mos_recieved) / 100000000) | number_format(2, '.', ',') }} Burst in
{{ (account.tx_count + account.mo_count + account.mos_count) }} transactions
{{ ((account.burst_recieved + account.mo_recieved + account.mos_recieved) / 100000000) | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }} in
{{ account.tx_in_count }} transactions
</td>
</tr>
<tr><th>Sent</th><td>{{ account.burst_sent }} Burst in {{ account.count_sent }} transactions</td></tr>
<tr><th>Transaction Fees</th><td>{{ account.fees_paid }} Burst paid</td></tr>
<tr><th>Potential pool reward</th><td>{{ (account.pool_balance_fee + account.pool_balance_forged) | number_format(2, '.', ',') }} Burst</td></tr>
<tr><th>Solo mined balance</th><td>{{ account.forged_balance }} Burst</td></tr>
<tr><th>Sent</th><td>{{ account.burst_sent }} {{ getEnv('RS_PREFIX') }} in {{ account.tx_out_count }} transactions</td></tr>
<tr><th>Transaction Fees</th><td>{{ account.fees_paid }} {{ getEnv('RS_PREFIX') }} paid</td></tr>
<tr><th>Potential pool reward</th><td>{{ (account.pool_balance_fee + account.pool_balance_forged) | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Solo mined balance</th><td>{{ account.forged_balance }} {{ getEnv('RS_PREFIX') }}</td></tr>
{% if account.pool_id is not null and account.pool_id != account.id %}
<tr><th>Pool</th>
<td>
......@@ -41,7 +41,7 @@
<div class="col-md-10">
<ul class="nav nav-tabs" id="accountTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="tx-tab" data-toggle="tab" href="#tx" role="tab" aria-controls="tx" aria-selected="true">Transactions ({{ (account.count_sent + account.tx_count + account.mo_count + account.mos_count) }})</a>
<a class="nav-link active" id="tx-tab" data-toggle="tab" href="#tx" role="tab" aria-controls="tx" aria-selected="true">Transactions ({{ account.tx_total_count }})</a>
</li>
<li class="nav-item">
<a class="nav-link" id="asset-tab" data-toggle="tab" href="#asset" role="tab" aria-controls="asset" aria-selected="false">Asset Transfers</a>
......
......@@ -28,7 +28,7 @@
</li-->
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Height, Burst-ID, ..." aria-label="Search">
<input class="form-control mr-sm-2" type="search" placeholder="Height, {{ getEnv('RS_PREFIX') }}-ID, ..." aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
......
......@@ -40,7 +40,7 @@
</ul>
<table class="table table-striped table-bordered table-hover table-sm">
<thead>
<th>ID</th>
<th>Transaction-ID</th>
<th>Type</th>
<th>Sender</th>
<th>Recipient</th>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment