commit
3bc1f780f2
@ -37,11 +37,12 @@ class Transaction extends Base {
|
|||||||
public function setArchived($account_id, $txid) {
|
public function setArchived($account_id, $txid) {
|
||||||
$stmt = $this->mysqli->prepare("
|
$stmt = $this->mysqli->prepare("
|
||||||
UPDATE $this->table AS t
|
UPDATE $this->table AS t
|
||||||
INNER JOIN " . $this->block->getTableName() . " AS b
|
LEFT JOIN " . $this->block->getTableName() . " AS b
|
||||||
ON b.id = t.block_id
|
ON b.id = t.block_id
|
||||||
SET t.archived = 1
|
SET t.archived = 1
|
||||||
WHERE t.account_id = ? AND t.id <= ? AND b.confirmations >= ?");
|
WHERE ( t.account_id = ? AND t.id <= ? AND b.confirmations >= ? )
|
||||||
if ($this->checkStmt($stmt) && $stmt->bind_param('iii', $account_id, $txid, $this->config['confirmations']) && $stmt->execute())
|
OR ( t.account_id = ? AND t.id <= ? AND t.type IN ( 'Credit_PPS', 'Donation_PPS', 'Fee_PPS', 'TXFee', 'Debit_MP', 'Debit_AP' ) )");
|
||||||
|
if ($this->checkStmt($stmt) && $stmt->bind_param('iiiii', $account_id, $txid, $this->config['confirmations'], $account_id, $txid) && $stmt->execute())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -221,7 +222,7 @@ class Transaction extends Base {
|
|||||||
$stmt = $this->mysqli->prepare("
|
$stmt = $this->mysqli->prepare("
|
||||||
SELECT
|
SELECT
|
||||||
ROUND((
|
ROUND((
|
||||||
SUM( IF( ( t.type IN ('Credit','Bonus') OR t.type = 'Credit_PPS') AND b.confirmations >= ?, t.amount, 0 ) ) -
|
SUM( IF( ( t.type IN ('Credit','Bonus') AND b.confirmations >= ? ) OR t.type = 'Credit_PPS', t.amount, 0 ) ) -
|
||||||
SUM( IF( t.type IN ('Debit_MP', 'Debit_AP'), t.amount, 0 ) ) -
|
SUM( IF( t.type IN ('Debit_MP', 'Debit_AP'), t.amount, 0 ) ) -
|
||||||
SUM( IF( ( t.type IN ('Donation','Fee') AND b.confirmations >= ? ) OR ( t.type IN ('Donation_PPS', 'Fee_PPS', 'TXFee') ), t.amount, 0 ) )
|
SUM( IF( ( t.type IN ('Donation','Fee') AND b.confirmations >= ? ) OR ( t.type IN ('Donation_PPS', 'Fee_PPS', 'TXFee') ), t.amount, 0 ) )
|
||||||
), 8) AS confirmed,
|
), 8) AS confirmed,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user