12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2019/4/13
- * Time: 10:29
- */
- namespace App\Admin\Exports\Jobfairout;
- use App\Admin\Exports\RowExport;
- class SchoolExport extends RowExport
- {
- /**
- * 设置标题,返回标题数组
- * @return array
- */
- public function headings(): array
- {
- return [
- '高校',
- '优势专业',
- '网址',
- '备注',
- '更新时间',
- '简介',
- ];
- }
- /**
- * 处理行数据
- * @param Model $row
- * @return array
- */
- public function map($row): array
- {
- $result['title'] = $row->name;
- $result['major'] = $row->major;
- $result['url'] = $row->url;
- $result['remarks'] = $row->remarks;
- $result['created_at'] = $row->created_at;
- $result['introduce'] = strip_tags($row->introduce);
- return $result;
- }
- /**
- * 设置文件名
- * @return string
- */
- public function getFilename(): string
- {
- return "jobfairout_schools.xlsx";
- }
- /**
- * 格式化指定列.
- * 只有在需要的时候设置,例如在身份证不要显示科学计数时设定列格式:['A'=>NumberFormat::FORMAT_NUMBER]
- * @return array
- */
- public function columnFormats(): array
- {
- return [
- ];
- }
- }
|