[*] BO : Do not insert duplicates in poruct_carrier, thanks @edamart
This commit is contained in:
1 parent
c0bc3bda29
commit
81e4a5f635
1 file changed
+8
-2
+8
-2
@@ -2384,8 +2384,14 @@ class ProductCore extends ObjectModel
|
|||||||
WHERE id_product = '.(int)$this->id.'
|
WHERE id_product = '.(int)$this->id.'
|
||||||
AND id_shop = '.(int)$this->id_shop
|
AND id_shop = '.(int)$this->id_shop
|
||||||
);
|
);
|
||||||
if (count($data))
|
|
||||||
Db::getInstance()->insert('product_carrier', $data);
|
$uniqueArray = array();
|
||||||
|
foreach($data as $subArray)
|
||||||
|
if(!in_array($subArray, $uniqueArray))
|
||||||
|
$uniqueArray[] = $subArray;
|
||||||
|
|
||||||
|
if (count($uniqueArray))
|
||||||
|
Db::getInstance()->insert('product_carrier', $uniqueArray, false, true, Db::INSERT_IGNORE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user