NEW filter on entity in import
This commit is contained in:
parent
62231d5b2f
commit
483e9814f9
@ -870,6 +870,10 @@ class ImportCsv extends ModeleImports
|
||||
$filters[] = $col.' = '.$data[$key];
|
||||
}
|
||||
}
|
||||
if (!empty($tablewithentity_cache[$tablename])) {
|
||||
$where[] = "entity = ".((int) $conf->entity);
|
||||
$filters[] = "entity = ".((int) $conf->entity);
|
||||
}
|
||||
$sqlSelect .= " WHERE ".implode(' AND ', $where);
|
||||
|
||||
$resql = $this->db->query($sqlSelect);
|
||||
@ -906,6 +910,10 @@ class ImportCsv extends ModeleImports
|
||||
}
|
||||
$sqlSelect .= " WHERE ".$keyfield." = ".((int) $lastinsertid);
|
||||
|
||||
if (!empty($tablewithentity_cache[$tablename])) {
|
||||
$sqlSelect .= " AND entity = ".((int) $conf->entity);
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sqlSelect);
|
||||
if ($resql) {
|
||||
$res = $this->db->fetch_object($resql);
|
||||
@ -951,6 +959,10 @@ class ImportCsv extends ModeleImports
|
||||
$sqlend = " WHERE " . implode(' AND ', $where);
|
||||
}
|
||||
|
||||
if (!empty($tablewithentity_cache[$tablename])) {
|
||||
$sqlend .= " AND entity = ".((int) $conf->entity);
|
||||
}
|
||||
|
||||
$sql = $sqlstart.$sqlend;
|
||||
|
||||
// Run update request
|
||||
|
||||
@ -916,6 +916,10 @@ class ImportXlsx extends ModeleImports
|
||||
$filters[] = $col.' = '.$data[$key];
|
||||
}
|
||||
}
|
||||
if (!empty($tablewithentity_cache[$tablename])) {
|
||||
$where[] = "entity = ".((int) $conf->entity);
|
||||
$filters[] = "entity = ".((int) $conf->entity);
|
||||
}
|
||||
$sqlSelect .= " WHERE " . implode(' AND ', $where);
|
||||
|
||||
$resql = $this->db->query($sqlSelect);
|
||||
@ -953,6 +957,10 @@ class ImportXlsx extends ModeleImports
|
||||
}
|
||||
$sqlSelect .= " WHERE ".$keyfield." = ".((int) $lastinsertid);
|
||||
|
||||
if (!empty($tablewithentity_cache[$tablename])) {
|
||||
$sqlSelect .= " AND entity = ".((int) $conf->entity);
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sqlSelect);
|
||||
if ($resql) {
|
||||
$res = $this->db->fetch_object($resql);
|
||||
@ -998,6 +1006,10 @@ class ImportXlsx extends ModeleImports
|
||||
$sqlend = " WHERE " . implode(' AND ', $where);
|
||||
}
|
||||
|
||||
if (!empty($tablewithentity_cache[$tablename])) {
|
||||
$sqlend .= " AND entity = ".((int) $conf->entity);
|
||||
}
|
||||
|
||||
$sql = $sqlstart . $sqlend;
|
||||
|
||||
// Run update request
|
||||
|
||||
Loading…
Reference in New Issue
Block a user