CompanyReportExport

This commit is contained in:
邓皓元 2019-08-12 14:36:33 +08:00
parent a25e5c02ff
commit aa88f1d0aa

View File

@ -1,11 +1,22 @@
<?php
use Carbon\Carbon;
use App\Domains\Export\Services\ExportService;
use App\Domains\Stats\Exports\CompanyReportExport;
require_once realpath(dirname(__FILE__) . '/TestCase.php');
$conditions = [
'company_name' = '福建车媒通网络科技有限公司',
'month' = '2016-01'
]
'company_name' => '福建车媒通网络科技有限公司',
'month' => '2016-01'
];
$export = new CompanyReportExport($conditions);
$url = ExportService::store($export, $this->disk);
$start = Carbon::parse('2016-01')->startOfMonth();
$end = Carbon::parse('2019-07')->endOfMonth();
for ($i = 0; $i <= $end->diffInMonths($start); $i++) {
$month = $start->copy()->addMonths($i)->format('Y-m');
$conditions['month'] = $month;
$export = new CompanyReportExport($conditions);
$url = ExportService::store($export, $this->disk);
}