[FIX] Added where clause for archived

This commit is contained in:
Sebastian Grewe 2013-12-02 16:50:16 +01:00
parent 7a2e6061ab
commit 7b41a75f92

View File

@ -40,8 +40,11 @@ class Transaction extends Base {
LEFT JOIN " . $this->block->getTableName() . " AS b
ON b.id = t.block_id
SET t.archived = 1
WHERE ( t.account_id = ? AND t.id <= ? AND b.confirmations >= ? )
OR ( t.account_id = ? AND t.id <= ? AND t.type IN ( 'Credit_PPS', 'Donation_PPS', 'Fee_PPS', 'TXFee', 'Debit_MP', 'Debit_AP' ) )");
WHERE t.archived = 0
AND (
( t.account_id = ? AND t.id <= ? AND b.confirmations >= ? )
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 $this->sqlError();