Better transformer.

This commit is contained in:
James Cole 2022-07-25 05:51:59 +02:00
parent 38b505d036
commit 2db32ce44f
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -119,7 +119,7 @@ class TransactionGroupTransformer extends AbstractTransformer
$type = $this->stringFromArray($transaction, 'transaction_type_type', TransactionType::WITHDRAWAL);
$amount = app('steam')->positive((string)($row['amount'] ?? '0'));
$foreignAmount = null;
if (null !== $row['foreign_amount']) {
if (null !== $row['foreign_amount'] && '' !== $row['foreign_amount'] && bccomp('0', $row['foreign_amount']) !== 0) {
$foreignAmount = app('steam')->positive($row['foreign_amount']);
}