Fix incorrect bus pro id assignment on import

This commit is contained in:
Björn Fromme
2018-10-29 12:29:35 +01:00
parent 1afbc9add0
commit 21fc292311
@@ -228,7 +228,7 @@ class DateImportService implements SingletonInterface
$dateCount = 0; $dateCount = 0;
$sql = ' $sql = '
SELECT p.uid uid, p.daytrip daytrip, p.important important, p.name product_name, p.bus_pro_id bus_pro_id, SELECT p.uid uid, p.daytrip daytrip, p.important important, p.name product_name,
p.searchable product_searchable, p.detail_page product_detail_page, p.keywords product_keywords, p.searchable product_searchable, p.detail_page product_detail_page, p.keywords product_keywords,
p.teaser product_teaser, p.feature product_feature, p.subline product_subline, p.country country, p.teaser product_teaser, p.feature product_feature, p.subline product_subline, p.country country,
p.region region, p.city city, p.region region, p.city city,
@@ -252,13 +252,12 @@ class DateImportService implements SingletonInterface
} }
foreach ($products as $product) foreach ($products as $product)
{ {
if (empty($product['bus_pro_id'])) { $this->db->update(
$this->db->update( 'tx_epproducts_domain_model_product',
'tx_epproducts_domain_model_product', ['bus_pro_id' => $busProId],
['bus_pro_id' => $busProId], ['uid' => $product['uid']]
['uid' => $product['uid']] );
); $product['bus_pro_id'] = $busProId;
}
$product['product_fact'] = $this->getTopFactForRecord('tx_epproducts_product_fact_mm', $product['uid']); $product['product_fact'] = $this->getTopFactForRecord('tx_epproducts_product_fact_mm', $product['uid']);
$product['region_fact'] = $this->getTopFactForRecord('tx_epproducts_region_fact_mm', $product['region']); $product['region_fact'] = $this->getTopFactForRecord('tx_epproducts_region_fact_mm', $product['region']);
foreach ($xmlProduct->termin as $xmlDate) foreach ($xmlProduct->termin as $xmlDate)