46 lines
1005 B
PHP
46 lines
1005 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Jobs;
|
||
|
|
|
||
|
|
use Illuminate\Bus\Queueable;
|
||
|
|
use Illuminate\Queue\SerializesModels;
|
||
|
|
use Illuminate\Queue\InteractsWithQueue;
|
||
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||
|
|
|
||
|
|
class ReportExport implements ShouldQueue
|
||
|
|
{
|
||
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||
|
|
|
||
|
|
protected $order;
|
||
|
|
protected $start_date, $end_date;
|
||
|
|
/**
|
||
|
|
* Create a new job instance.
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
public function __construct($order, $start_date=null, $end_date=null)
|
||
|
|
{
|
||
|
|
$this->order = $order;
|
||
|
|
$this->start_date = $start_date;
|
||
|
|
$this->end_date = $end_date;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Execute the job.
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
public function handle()
|
||
|
|
{
|
||
|
|
ini_set('memory_limit','-1');
|
||
|
|
\App\Exports\ReportExport::export($this->order, $this->start_date, $this->end_date);
|
||
|
|
}
|
||
|
|
public function retryUntil()
|
||
|
|
{
|
||
|
|
return now()->addSeconds(87000);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|