$data * @return array */ protected function withLedgerRemarks(array $data, string $tab): array { if (! empty($data['data']) && is_array($data['data'])) { $map = $this->ledgerRemarkMap(); $data['data'] = array_map( static fn (mixed $row): mixed => is_array($row) ? $map->decorate($row, $tab) : $row, $data['data'], ); } return $data; } /** * 导出/流式行补总账备注。 * * @param iterable> $rows * @return iterable> */ protected function ledgerRemarkRows(iterable $rows, string $tab): iterable { return $this->ledgerRemarkMap()->decorateAll($rows, $tab); } }