[-] IN: Fix [insert order detail 1] error while upgrading
This commit is contained in:
1 parent
062fb90c2e
commit
a5bb4f0323
1 file changed
+15
-17
@@ -75,7 +75,7 @@ function migrate_orders()
|
|||||||
WHERE name = "PS_GIFT_WRAPPING_TAX"') / 100);
|
WHERE name = "PS_GIFT_WRAPPING_TAX"') / 100);
|
||||||
|
|
||||||
$cpt = 0;
|
$cpt = 0;
|
||||||
$flush_limit = 500;
|
$flush_limit = 250;
|
||||||
while ($order = Db::getInstance()->nextRow($order_res))
|
while ($order = Db::getInstance()->nextRow($order_res))
|
||||||
{
|
{
|
||||||
$sum_total_products = 0;
|
$sum_total_products = 0;
|
||||||
@@ -115,7 +115,8 @@ function migrate_orders()
|
|||||||
else
|
else
|
||||||
$order_details[$k] = Db::getInstance()->escape($order_details[$k]);
|
$order_details[$k] = Db::getInstance()->escape($order_details[$k]);
|
||||||
}
|
}
|
||||||
$values_order_detail[] = '(\''.implode('\', \'', $order_details).'\')';
|
if (count($order_details))
|
||||||
|
$values_order_detail[] = '(\''.implode('\', \'', $order_details).'\')';
|
||||||
}
|
}
|
||||||
|
|
||||||
$average_tax_used = 1;
|
$average_tax_used = 1;
|
||||||
@@ -154,34 +155,31 @@ function migrate_orders()
|
|||||||
if ($cpt >= $flush_limit)
|
if ($cpt >= $flush_limit)
|
||||||
{
|
{
|
||||||
$cpt = 0;
|
$cpt = 0;
|
||||||
if (!Db::getInstance()->execute($insert_order_detail. implode(',', $values_order_detail)))
|
|
||||||
|
if (count($values_order_detail) && !Db::getInstance()->execute($insert_order_detail. implode(',', $values_order_detail)))
|
||||||
{
|
{
|
||||||
$res = false;
|
$res = false;
|
||||||
$array_errors[] = '[insert order detail 1] - '.Db::getInstance()->getMsgError();
|
$array_errors[] = '[insert order detail 1] - '.Db::getInstance()->getMsgError();
|
||||||
}
|
}
|
||||||
if (!Db::getInstance()->execute($insert_order. implode(',', $values_order)))
|
if (count($values_order) && !Db::getInstance()->execute($insert_order. implode(',', $values_order)))
|
||||||
{
|
{
|
||||||
$res = false;
|
$res = false;
|
||||||
$array_errors[] = '[insert order 1] - '.Db::getInstance()->getMsgError();
|
$array_errors[] = '[insert order 2] - '.Db::getInstance()->getMsgError();
|
||||||
}
|
}
|
||||||
$values_order = array();
|
$values_order = array();
|
||||||
$values_order_detail = array();
|
$values_order_detail = array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($values_order_detail))
|
if (count($values_order_detail) && !Db::getInstance()->execute($insert_order_detail. implode(',', $values_order_detail)))
|
||||||
{
|
{
|
||||||
|
$res = false;
|
||||||
if (!Db::getInstance()->execute($insert_order_detail. implode(',', $values_order_detail)))
|
$array_errors[] = '[insert order detail 3] - '.Db::getInstance()->getMsgError();
|
||||||
{
|
}
|
||||||
$res = false;
|
if (count($values_order) && !Db::getInstance()->execute($insert_order. implode(',', $values_order)))
|
||||||
$array_errors[] = '[insert order detail 2] - '.Db::getInstance()->getMsgError();
|
{
|
||||||
}
|
$res = false;
|
||||||
if (!Db::getInstance()->execute($insert_order. implode(',', $values_order)))
|
$array_errors[] = '[insert order 4] - '.Db::getInstance()->getMsgError();
|
||||||
{
|
|
||||||
$res = false;
|
|
||||||
$array_errors[] = '[insert order 2] - '.Db::getInstance()->getMsgError();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mo_renameTables())
|
if (!mo_renameTables())
|
||||||
|
|||||||
Reference in new issue
Block a user