96 lines
2.5 KiB
PHP
96 lines
2.5 KiB
PHP
<?php
|
|
|
|
use Dipper\Excel\Facades\Excel;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use App\Domains\Export\Services\ExportService;
|
|
use App\Domains\Stats\Exports\CompanyYearReportExport;
|
|
|
|
require_once realpath(dirname(__FILE__) . '/TestCase.php');
|
|
|
|
$disk = 'public';
|
|
|
|
//
|
|
$conditions = [
|
|
"limit" => 0,
|
|
"type" => [0, 1],
|
|
"year" => "2018",
|
|
"sell_starttime" => "2017-01-01 00:00:00",
|
|
"sell_endtime" => "2017-12-31 23:59:59",
|
|
];
|
|
$filename = "2017销售在2018年报表.xlsx";
|
|
$export = new CompanyYearReportExport($conditions);
|
|
Excel::store($export, $filename, 'public');
|
|
$url = Storage::disk($disk)->url($filename);
|
|
echo $url . PHP_EOL;
|
|
|
|
|
|
$conditions = [
|
|
"limit" => 0,
|
|
"type" => [0, 1],
|
|
"year" => "2019",
|
|
"sell_starttime" => "2017-01-01 00:00:00",
|
|
"sell_endtime" => "2017-12-31 23:59:59",
|
|
];
|
|
|
|
$filename = "2017销售在2019年报表.xlsx";
|
|
$export = new CompanyYearReportExport($conditions);
|
|
Excel::store($export, $filename, 'public');
|
|
$url = Storage::disk($disk)->url($filename);
|
|
echo $url . PHP_EOL;
|
|
|
|
$conditions = [
|
|
"limit" => 0,
|
|
"type" => [0, 1],
|
|
"year" => "2020",
|
|
"sell_starttime" => "2017-01-01 00:00:00",
|
|
"sell_endtime" => "2017-12-31 23:59:59",
|
|
];
|
|
|
|
$filename = "2017销售在2020年报表.xlsx";
|
|
$export = new CompanyYearReportExport($conditions);
|
|
Excel::store($export, $filename, 'public');
|
|
$url = Storage::disk($disk)->url($filename);
|
|
echo $url . PHP_EOL;
|
|
|
|
$conditions = [
|
|
"limit" => 0,
|
|
"type" => [0, 1],
|
|
"year" => "2019",
|
|
"sell_starttime" => "2018-01-01 00:00:00",
|
|
"sell_endtime" => "2018-12-31 23:59:59",
|
|
];
|
|
|
|
$filename = "2018销售在2019年报表.xlsx";
|
|
$export = new CompanyYearReportExport($conditions);
|
|
Excel::store($export, $filename, 'public');
|
|
$url = Storage::disk($disk)->url($filename);
|
|
echo $url . PHP_EOL;
|
|
|
|
$conditions = [
|
|
"limit" => 0,
|
|
"type" => [0, 1],
|
|
"year" => "2020",
|
|
"sell_starttime" => "2018-01-01 00:00:00",
|
|
"sell_endtime" => "2018-12-31 23:59:59",
|
|
];
|
|
|
|
$filename = "2018销售在2020年报表.xlsx";
|
|
$export = new CompanyYearReportExport($conditions);
|
|
Excel::store($export, $filename, 'public');
|
|
$url = Storage::disk($disk)->url($filename);
|
|
echo $url . PHP_EOL;
|
|
|
|
$conditions = [
|
|
"limit" => 0,
|
|
"type" => [0, 1],
|
|
"year" => "2020",
|
|
"sell_starttime" => "2019-01-01 00:00:00",
|
|
"sell_endtime" => "2019-12-31 23:59:59",
|
|
];
|
|
|
|
$filename = "2019销售在2020年报表.xlsx";
|
|
$export = new CompanyYearReportExport($conditions);
|
|
Excel::store($export, $filename, 'public');
|
|
$url = Storage::disk($disk)->url($filename);
|
|
echo $url . PHP_EOL;
|