Merge pull request '优化标签单导出功能' (#248) from dev into main
Reviewed-on: #248
This commit is contained in:
commit
d42a6f5b99
@ -26,15 +26,17 @@ class Beforehand
|
|||||||
$fontStyle2 = ['name' => 'Arial', 'size' => 8, 'bold' => true];
|
$fontStyle2 = ['name' => 'Arial', 'size' => 8, 'bold' => true];
|
||||||
$fontStyle3 = ['name' => 'Arial', 'size' => 8, 'bold' => true];
|
$fontStyle3 = ['name' => 'Arial', 'size' => 8, 'bold' => true];
|
||||||
|
|
||||||
|
$count = count($data);
|
||||||
foreach ($data as $k => $v) {
|
foreach ($data as $k => $v) {
|
||||||
$textRun = $section->addTextRun();
|
$textRun = $section->addTextRun();
|
||||||
|
|
||||||
$textRun->addText($v['system_store'], $fontStyle);
|
$textRun->addText($v['system_store'], $fontStyle);
|
||||||
$textRun->addText(' ' . $v['subtitle'], $fontStyle1);
|
$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);
|
$section->addText($v['address'], $fontStyle3);
|
||||||
|
if($k+1!=$count){
|
||||||
$section->addPageBreak();
|
$section->addPageBreak();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
|
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user