38 lines
904 B
PHP
38 lines
904 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Exports\ReportFormExport;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
class MakeReportForm implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
protected $start_date, $end_date;
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($start_date, $end_date)
|
|
{
|
|
$this->start_date = $start_date;
|
|
$this->end_date = $end_date;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
return \Excel::download( new ReportFormExport($this->start_date, $this->end_date), $this->start_date.'至'.$this->end_date.'福恋报表.xlsx');
|
|
}
|
|
}
|