chunkSize
This commit is contained in:
parent
837bd9f86d
commit
19fc32a976
@ -25,6 +25,8 @@ class CompanyReportDetailExport extends AbstractExport implements FromQuery, Wit
|
|||||||
|
|
||||||
public static $types = ['用户', '用户', '增值包', '增值包'];
|
public static $types = ['用户', '用户', '增值包', '增值包'];
|
||||||
|
|
||||||
|
public static $chunkSize = 10000;
|
||||||
|
|
||||||
public function __construct(array $conditions = [])
|
public function __construct(array $conditions = [])
|
||||||
{
|
{
|
||||||
$this->conditions = $conditions;
|
$this->conditions = $conditions;
|
||||||
@ -33,7 +35,7 @@ class CompanyReportDetailExport extends AbstractExport implements FromQuery, Wit
|
|||||||
|
|
||||||
public function chunkSize(): int
|
public function chunkSize(): int
|
||||||
{
|
{
|
||||||
return 150000;
|
return self::$chunkSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function querySize(): int
|
public function querySize(): int
|
||||||
|
@ -87,7 +87,7 @@ class CompanyReportController extends Controller
|
|||||||
try {
|
try {
|
||||||
$export = new CompanyReportDetailExport($conditions);
|
$export = new CompanyReportDetailExport($conditions);
|
||||||
|
|
||||||
$queue = $total > 50000;
|
$queue = $total > CompanyReportDetailExport::$chunkSize * 50;
|
||||||
|
|
||||||
$url = ExportService::store($export, $this->disk, $queue);
|
$url = ExportService::store($export, $this->disk, $queue);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user