Merge pull request '优化标签单导出功能' (#248) from dev into main

Reviewed-on: #248
This commit is contained in:
mkm 2024-10-09 15:33:12 +08:00
commit d42a6f5b99

View File

@ -26,15 +26,17 @@ class Beforehand
$fontStyle2 = ['name' => 'Arial', 'size' => 8, 'bold' => true];
$fontStyle3 = ['name' => 'Arial', 'size' => 8, 'bold' => true];
$count = count($data);
foreach ($data as $k => $v) {
$textRun = $section->addTextRun();
$textRun->addText($v['system_store'], $fontStyle);
$textRun->addText(' ' . $v['subtitle'], $fontStyle1);
$section->addText(mb_substr( $v['store_name'], 0, 16, 'UTF-8'), $fontStyle2);
$section->addText($v['store_name'], $fontStyle2);
$section->addText($v['address'], $fontStyle3);
if($k+1!=$count){
$section->addPageBreak();
}
}
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');