Order increment id not saving correctly
-
29-09-2020 - |
题
I have code that saves order details to a custom table:
foreach($links as $link) {
$pdf = Mage::getModel('custom_sales/pdf');
$pdf->setOrderId($order->getId())
->setOrderIncrementId($order->getIncrementId())
->setLink($link)
->save();
}
The code saves the records, and the order_id and link columns are correct, but the order increment id's are completely wrong e.g. an order with increment ID 15070100396216
has it's increment ID saved as 4294967295
The table structure is as follows:
`entity_id` int(10) UNSIGNED NOT NULL auto_increment,
`order_id` INTEGER(14) UNSIGNED NOT NULL,
`order_increment_id` INTEGER(20) UNSIGNED NOT NULL,
`link` VARCHAR(255) NOT NULL DEFAULT '',
Does anyone have any clue why this might be happening?
解决方案
I have seen your table structure you should use below mentioned solution that resolve your issue.
Datatype increment_id
in sales_flat_order
table is varchar(50)
try to change datatype of order_increment_id
to varchar(50)
in your table that may resolve your issue.