update code
This commit is contained in:
38
app/Exports/PrivateDocumentsExport.php
Normal file
38
app/Exports/PrivateDocumentsExport.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date;
|
||||
|
||||
class PrivateDocumentsExport extends BaseDocumentsExport
|
||||
{
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Ngày ban hành',
|
||||
'Ký hiệu',
|
||||
'Loại',
|
||||
'Trích yếu',
|
||||
'Người nhận',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $document
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function map($document): array
|
||||
{
|
||||
return [
|
||||
Date::dateTimeToExcel($document->effective_at),
|
||||
$document->symbol,
|
||||
$document->type->name,
|
||||
$document->abstract,
|
||||
implode(', ', ($document->organizes->map(function($organize){
|
||||
return $organize->name;
|
||||
}))->toArray()),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user