php - 转换为 excel 时卡在 MySQL/MariaDB 占位符限制 - laravel 5.7
问题描述
我有这个查询来获取要转换为 Excel 的数组:
if($sfname=='ALL'){
$st_outlet_reg = Sfs::wherebetween('created', [$datefrom, $dateto])
->when($cluster, function($query, $cluster) {
$query->where('cluster', $cluster);
})->get();
}
nomor = 0;
foreach ($st_outlet_reg as $key => $value) {
$nomor++;
$i= $key+2;
$sheet->cell('A'.$i, $sfname)->setFontSize('10');
$sheet->cell('B'.$i, $value['outlet_id'])->setFontSize('10');
$sheet->cell('C'.$i, $value['nama_outlet'])->setFontSize('10');
$sheet->cell('D'.$i, $value['created'])->setFontSize('10');
$sheet->cell('E'.$i, $value['msisdn'])->setFontSize('10');
$sheet->cell('A'.$i, function($cell1) {
$cell1->setBorder('thin', 'thin', 'thin', 'thin')->setAlignment('center'); });
$sheet->cell('B'.$i, function($cell1) {
$cell1->setBorder('thin', 'thin', 'thin', 'thin')->setAlignment('center'); });
$sheet->cell('C'.$i, function($cell1) {
$cell1->setBorder('thin', 'thin', 'thin', 'thin')->setAlignment('center'); });
$sheet->cell('D'.$i, function($cell1) {
$cell1->setBorder('thin', 'thin', 'thin', 'thin')->setAlignment('center'); });
$sheet->cell('E'.$i, function($cell1) {
$cell1->setBorder('thin', 'thin', 'thin', 'thin')->setAlignment('center'); });
}
如何解决这个问题