fix report ۴
This commit is contained in:
@@ -395,10 +395,21 @@ class WalletController extends Controller
|
||||
])->export($records);
|
||||
|
||||
if (isset($records['rows'])) {
|
||||
foreach ($records['rows'] as &$row) {
|
||||
$records['rows'] = collect($records['rows'])->map(function ($row) use ($balanceReport, $catalogMetalIds) {
|
||||
$balanceReport->enrichTransactionTableRow($row, $catalogMetalIds);
|
||||
}
|
||||
unset($row);
|
||||
|
||||
if ($row instanceof Transaction) {
|
||||
$array = $row->toArray();
|
||||
$rawTypeStr = $row->getAttributes()['type_str'] ?? null;
|
||||
if (is_string($rawTypeStr) && !is_numeric(trim($rawTypeStr))) {
|
||||
$array['type_str'] = $rawTypeStr;
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
return is_array($row) ? $row : (array) $row;
|
||||
})->values()->all();
|
||||
}
|
||||
|
||||
$records['catalogMetals'] = $balanceReport->catalogMetalsMeta();
|
||||
|
||||
Reference in New Issue
Block a user