提交代码
This commit is contained in:
22
app/Admin/Exporters/ProvinceExporter.php
Normal file
22
app/Admin/Exporters/ProvinceExporter.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Exporters;
|
||||
|
||||
use Encore\Admin\Grid\Exporters\ExcelExporter;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
|
||||
class ProvinceExporter extends ExcelExporter implements WithMapping
|
||||
{
|
||||
protected $fileName = '省市管理.xlsx';
|
||||
|
||||
protected $columns = [
|
||||
'shortname' => '省市区名称',
|
||||
];
|
||||
|
||||
public function map($area): array
|
||||
{
|
||||
return [
|
||||
$area->shortname,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user