From 0305278b47a14410e3b33f19af1f083ac0efd80c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Fri, 15 Mar 2019 10:49:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8B=E8=BD=BD=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E7=BC=BA=E5=B0=91=E6=A0=B7=E5=BC=8F=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rongyu/controller/JsRongyuInfo.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/application/rongyu/controller/JsRongyuInfo.php b/application/rongyu/controller/JsRongyuInfo.php index 61373fdb..7a4f144b 100644 --- a/application/rongyu/controller/JsRongyuInfo.php +++ b/application/rongyu/controller/JsRongyuInfo.php @@ -455,17 +455,19 @@ class JsRongyuInfo extends Base $worksheet->getCell('H'.$myrowid)->setValue($value->bianhao); } + // 给单元格加边框 + $styleArray = [ + 'borders' => [ + 'allBorders' => [ + 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN, + 'color' => ['argb' => '00000000'], + ], + ], + ]; + if($key+4>9) { - // 给单元格加边框 - $styleArray = [ - 'borders' => [ - 'allBorders' => [ - 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN, - 'color' => ['argb' => '00000000'], - ], - ], - ]; + $worksheet->getStyle('A10:I'.($key+4))->applyFromArray($styleArray); // 设置行高 for($i = 10; $i<=($key+4); $i++){