修改excel路径,自动跳过excel为空的行

master
liuweiwen 5 years ago
parent 1def746be4
commit 69013539cd

@ -64,6 +64,7 @@ class BatchImportExcelEvent extends Controller{
if($currentColumn == "C"){ if($currentColumn == "C"){
$currentvalue = $sheet->getCell($address)->getValue(); $currentvalue = $sheet->getCell($address)->getValue();
if (empty($currentvalue)) { if (empty($currentvalue)) {
continue;
unlink($file); unlink($file);
throw new \Exception($address.' 数据为空'); throw new \Exception($address.' 数据为空');
} }
@ -86,6 +87,7 @@ class BatchImportExcelEvent extends Controller{
}else{ }else{
$currentvalue = $sheet->getCell($address)->getValue(); $currentvalue = $sheet->getCell($address)->getValue();
if (empty($currentvalue)) { if (empty($currentvalue)) {
continue;
unlink($file); unlink($file);
throw new \Exception($address.' 数据为空'); throw new \Exception($address.' 数据为空');
} }

@ -42,7 +42,7 @@
<tbody> <tbody>
<tr> <tr>
<td class="r"> Execl模板:</td> <td class="r"> Execl模板:</td>
<td><a href="/Uploads/excel/区服列表-游戏名称.xls">下载模板</a></td> <td><a href="/Public/Admin/excel/区服列表-游戏名称.xls">下载模板</a></td>
</tr> </tr>
<tr> <tr>
<td class="r">导入模板</td> <td class="r">导入模板</td>

Loading…
Cancel
Save