new Excel
This commit is contained in:
parent
20fd6ed717
commit
97ccf8696c
@ -1,6 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Dipper\Excel\Excel;
|
||||
use Dipper\Excel\Reader;
|
||||
use Dipper\Excel\Writer;
|
||||
use Dipper\Excel\QueuedWriter;
|
||||
use App\Domains\Export\Services\ExportService;
|
||||
use App\Domains\Stats\Exports\CompanyReportExport;
|
||||
|
||||
@ -16,11 +20,16 @@ $start = Carbon::parse('2016-01')->startOfMonth();
|
||||
$end = Carbon::parse('2019-07')->endOfMonth();
|
||||
|
||||
for ($i = 0; $i <= $end->diffInMonths($start); $i++) {
|
||||
sleep(1);
|
||||
$month = $start->copy()->addMonths($i)->format('Y-m');
|
||||
$conditions['month'] = $month;
|
||||
echo $month . PHP_EOL;
|
||||
$export = new CompanyReportExport($conditions);
|
||||
$url = ExportService::store($export, 'public');
|
||||
$excel = new Excel(
|
||||
app()->make(Writer::class),
|
||||
app()->make(QueuedWriter::class),
|
||||
app()->make(Reader::class),
|
||||
app()->make('filesystem')
|
||||
);
|
||||
$excel->store($export, $export->filename, 'public');
|
||||
unset($export);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user