Don't update 'createdAt' while updating order in retailCRM

This commit is contained in:
Pavel 2019-07-03 16:35:54 +03:00
parent a3b10b6eda
commit eb507ea62d
3 changed files with 3 additions and 6 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea

View File

@ -52,7 +52,7 @@ class ModelRetailcrmOrder extends Model {
} }
} }
$order['createdAt'] = date('Y-m-d H:i:s'); $order['createdAt'] = isset($order_data['date_added']) ? $order_data['date_added'] : date('Y-m-d H:i:s');
$payment_code = $order_data['payment_code']; $payment_code = $order_data['payment_code'];
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; $order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
@ -154,9 +154,7 @@ class ModelRetailcrmOrder extends Model {
} }
} }
$order['createdAt'] = date('Y-m-d H:i:s');
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; $order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
$country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ; $country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ;
$order['delivery'] = array( $order['delivery'] = array(

View File

@ -56,7 +56,7 @@ class ModelRetailcrmOrder extends Model {
} }
} }
$order['createdAt'] = date('Y-m-d H:i:s'); $order['createdAt'] = isset($order_data['date_added']) ? $order_data['date_added'] : date('Y-m-d H:i:s');
$payment_code = $order_data['payment_code']; $payment_code = $order_data['payment_code'];
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; $order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
@ -162,9 +162,7 @@ class ModelRetailcrmOrder extends Model {
} }
} }
$order['createdAt'] = date('Y-m-d H:i:s');
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; $order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
$country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ; $country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ;
$order['delivery'] = array( $order['delivery'] = array(