| 123456789101112131415161718192021222324 |
- <?php
- namespace App\Exports;
- use Maatwebsite\Excel\Concerns\WithMultipleSheets;
- class ResearchExpenseSummaryMultipleSheetExport implements WithMultipleSheets
- {
- protected $data; // 格式: ['2026' => [ 'items' => [...], 'summary' => [...] ], '2025' => [...] ]
- public function __construct(array $data)
- {
- $this->data = $data;
- }
- public function sheets(): array
- {
- $sheets = [];
- foreach ($this->data as $year => $payload) {
- $sheets[] = new ResearchExpenseSummarySheetExport($year, $payload);
- }
- return $sheets;
- }
- }
|