From bdb16dac546fdfb4c2e258a616ad881abd6d5bde Mon Sep 17 00:00:00 2001 From: brusnitsyn Date: Mon, 22 Jun 2026 17:01:59 +0900 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20pd?= =?UTF-8?q?f=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=20=D0=B8=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Analytics/Export/AnalyticsPdfExport.php | 20 +++++++++ .../views/reports/analytics_pdf.blade.php | 43 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 app/Services/Analytics/Export/AnalyticsPdfExport.php create mode 100644 resources/views/reports/analytics_pdf.blade.php diff --git a/app/Services/Analytics/Export/AnalyticsPdfExport.php b/app/Services/Analytics/Export/AnalyticsPdfExport.php new file mode 100644 index 0000000..d56b5ca --- /dev/null +++ b/app/Services/Analytics/Export/AnalyticsPdfExport.php @@ -0,0 +1,20 @@ + $title, + 'columns' => array_map(fn ($c) => $c->toArray(), $result->columns), + 'rows' => $result->rows, + 'generatedAt' => now('Asia/Yakutsk')->format('d.m.Y H:i'), + ])->setPaper('a4', 'landscape'); + } +} diff --git a/resources/views/reports/analytics_pdf.blade.php b/resources/views/reports/analytics_pdf.blade.php new file mode 100644 index 0000000..a2ec253 --- /dev/null +++ b/resources/views/reports/analytics_pdf.blade.php @@ -0,0 +1,43 @@ + + + + + {{ $title }} + + + +

{{ $title }}

+

Сформирован {{ $generatedAt }}

+ + @if (empty($rows)) +

Нет данных за выбранный период.

+ @else + + + + @foreach ($columns as $column) + + @endforeach + + + + @foreach ($rows as $row) + + @foreach ($columns as $column) + + @endforeach + + @endforeach + +
{{ $column['label'] }}
{{ $row[$column['key']] ?? '' }}
+ @endif + +