Untitled
unknown
php
5 years ago
559 B
86
No Index
$documents = FE::select('document_id')->has('feEvents')->pluck('document_id');
$chunkedDocuments = $documents->chunk(50000);
$companies = collect();
foreach ($chunkedDocuments as $chunk) {
$companies = $companies->merge(Company::select('companies.*')
->join('documents', 'documents.issuer_company_id', '=', 'companies.id')
->whereIn('documents.id', $chunk->all())
->whereNotNull('companies.fe_guid')
->groupBy('companies.id')
->get());
}
$companies = $companies->unique('id');
break;Editor is loading...