1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-18 12:30:35 +01:00

Ottimizzazione import articoli CSV

This commit is contained in:
loviuz 2023-07-25 17:05:46 +02:00
parent 4703738541
commit 72790d5fe5

View File

@ -218,12 +218,16 @@ class CSV extends CSVImporter
$number++; $number++;
} }
$rows = $this->getRows(0, $number); // Lettura primo record: se non c'è la pulizia listini da fare, esco, altrimenti
// si rischia una lettura di troppi dati insieme
$rows = $this->getRows(0, 2);
$first_record = $this->getRecord($rows[1]); $first_record = $this->getRecord($rows[1]);
if (!isset($first_record['anagrafica_listino']) || empty($this->getPrimaryKey())) { if (!isset($first_record['anagrafica_listino']) || empty($this->getPrimaryKey())) {
return; return;
} }
$rows = $this->getRows(0, $number);
foreach ($rows as $row) { foreach ($rows as $row) {
// Interpretazione secondo la selezione // Interpretazione secondo la selezione
$record = $this->getRecord($row); $record = $this->getRecord($row);