1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- namespace App\Exports;
- use App\Models\User;
- use Illuminate\Support\Facades\Log;
- use Maatwebsite\Excel\Concerns\FromCollection;
- use Maatwebsite\Excel\Concerns\WithEvents;
- use Maatwebsite\Excel\Concerns\WithHeadings;
- use Maatwebsite\Excel\Concerns\WithTitle;
- use Maatwebsite\Excel\Events\AfterSheet;
- class ExcelExport implements FromCollection, WithHeadings, WithEvents
- {
- public function collection()
- {
- return collect(
- [
- ['2024年9月', '艳霞', '156****9339', '38', 0, '38', '20', '760', '小温', '133****3328', '批发商'],
- ['2024年9月', '艳霞', '156****9339', '38', 0, '38', '20', '760', '小温', '133****3328', '批发商'],
- ['2024年9月', '艳霞', '156****9339', '38', 0, '38', '20', '760', '小温', '133****3328', '批发商'],
- ['2024年9月', '艳霞', '156****9339', '38', 0, '38', '20', '760', '小温', '133****3328', '批发商'],
- ['2024年9月', '艳霞', '156****9339', '38', 0, '38', '20', '760', '小温', '133****3328', '批发商'],
- ]
- );
- }
- public function headings(): array
- {
- return ['进货月份', '进货人(批发商)昵称', '进货人(批发商)手机号', '半醉浓香型件数', '半醉酱香型件数',
- '件数合计',
- '每件补助',
- '补助金额',
- '补助接收者昵称',
- '补助接收者手机号',
- '补助接收者身份']
- ;
- }
- public function registerEvents(): array
- {
- return [
- AfterSheet::class => function(AfterSheet $event) {
-
- $sheet = $event->sheet;
-
- },
- ];
- }
- }
|