mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
importvorlage artikeleigenschaften
This commit is contained in:
parent
29f76aa9d9
commit
ef8825faa8
@ -18692,6 +18692,14 @@
|
||||
"id"
|
||||
],
|
||||
"Non_unique": ""
|
||||
},
|
||||
{
|
||||
"Key_name": "eigenschaft_unique",
|
||||
"Index_type": "BTREE",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"Non_unique": "UNIQUE"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -18802,6 +18810,15 @@
|
||||
"artikel"
|
||||
],
|
||||
"Non_unique": ""
|
||||
},
|
||||
{
|
||||
"Key_name": "eigenschaft_artikel_unique",
|
||||
"Index_type": "BTREE",
|
||||
"columns": [
|
||||
"artikel",
|
||||
"artikeleigenschaften"
|
||||
],
|
||||
"Non_unique": "UNIQUE"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -4069,6 +4069,25 @@ class Importvorlage extends GenImportvorlage {
|
||||
}
|
||||
}
|
||||
|
||||
// Artikeleigenschaften
|
||||
// leer = löschen
|
||||
|
||||
$artikeleigenschaften = array();
|
||||
foreach ($tmp as $feldname => $feldwerte) {
|
||||
if (strpos($feldname,'eigenschaftname') !== false) {
|
||||
$eigenschaftspaltennummer = substr($feldname,strlen('eigenschaftname'));
|
||||
$artikeleigenschaften[$feldwerte[$i]] = $tmp['eigenschaftwert'.$eigenschaftspaltennummer][$i];
|
||||
}
|
||||
}
|
||||
foreach ($artikeleigenschaften as $key => $value) {
|
||||
$sql = "INSERT INTO artikeleigenschaften (name) VALUES ('".$key."') ON DUPLICATE KEY UPDATE name = '".$key."'";
|
||||
$this->app->DB->Update($sql);
|
||||
$sql = "INSERT INTO artikeleigenschaftenwerte (artikel, artikeleigenschaften, wert) VALUES ('".$artikelid."' ,(SELECT id FROM artikeleigenschaften WHERE name = '".$key."'), '".$value."') ON DUPLICATE KEY UPDATE wert = '".$value."'";
|
||||
$this->app->DB->Update($sql);
|
||||
}
|
||||
$sql = "DELETE FROM artikeleigenschaftenwerte WHERE wert = ''";
|
||||
$this->app->DB->Delete($sql);
|
||||
|
||||
//freifelduebersetzungen
|
||||
foreach ($tmp as $feldname => $feldwerte) {
|
||||
if(strpos($feldname,'freifeld') !== false && strpos($feldname,'_')>0){
|
||||
|
Loading…
Reference in New Issue
Block a user