Laravel Excel在创建csv文件时超时

时间:2017-01-20 13:09:11

标签: laravel-excel

我正在尝试创建一个包含10万条记录的csv文件,但它已超时。如果我运行10 000条记录就可以了。

$users1 = Aapplicant::select(DB::raw('applicant.AppID as Application_ID,
                        tapplicant.Email,
                        tapplicant.AppDate as Application_Date,
                        tapplicant.AppIPAddress as IP_Address,
                        tapplicant.AppAffID as Affiliate_ID,
                        toutcome.Status as Application_Status,'))
                        ->join('outcome', 'outcome.AppID', '=', 'applicant.AppID')
 ->where('AppDate', '>=', \Carbon\Carbon::now()->startOfMonth())                            
->orderBy('tapplicant.AppID', 'DESC')
                            ->get();

Excel::create('tapplicant', function($excel) use($users1) {

                        $excel->sheet('Sheet 1', function($sheet) use($users1) {

                            $sheet->fromArray($users1);

                        });

                    })->store('csv');

0 个答案:

没有答案