| 12345678910111213141516171819202122 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use Excel;
- class ExcelModel extends Model
- {
- //导出数据
- protected function downloadExcel($cellData,$title)
- {
- array_unshift($cellData,$title);
- Excel::create('金币场充值数据',function($excel) use ($cellData){
- $excel->sheet('score', function($sheet) use ($cellData){
- $sheet->rows($cellData);
- $sheet->setWidth(array('A'=>15,'B'=>15,'C'=>15,'D'=>15,'E'=>15,'F'=>15,'G'=>15,'H'=>15));
- });
- })->export('xls');
- }
- }
|