Update Bugs Fix Import
This commit is contained in:
@@ -64,22 +64,22 @@ class ImportService{
|
||||
|
||||
public function addArrayToRow($array, $sheetName = null)
|
||||
{
|
||||
// Switch to the correct Sheet Before Write
|
||||
if ($sheetName) {
|
||||
if ($sheetName != $this->writer->getCurrentSheet()->getName()) {
|
||||
|
||||
foreach ($this->writer->getSheetIterator() as $sheet) {
|
||||
if ($sheet->getName() == $sheet) {
|
||||
$this->writer->setCurrentSheet($sheet);
|
||||
break;
|
||||
// Switch to the correct Sheet Before Write
|
||||
if ($sheetName) {
|
||||
$currentSheet = $this->writer->getCurrentSheet();
|
||||
if ($sheetName != $currentSheet->getName()) {
|
||||
$sheets = $this->writer->getSheets();
|
||||
foreach ($sheets as $sheet) {
|
||||
if ($sheet->getName() == $sheetName) {
|
||||
$this->writer->setCurrentSheet($sheet); // Set the correct sheet
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$newRow = $this->makeRow($array);
|
||||
$this->writer->addRow($newRow);
|
||||
|
||||
return $this;
|
||||
$newRow = $this->makeRow($array);
|
||||
// $this->writer->addRow($newRow);
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user