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