Zwiększenie liczby zamówień przetwarzanych w cron.php oraz poprawa logiki aktualizacji statusu zamówienia
This commit is contained in:
5
cron.php
5
cron.php
@@ -674,7 +674,9 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se
|
|||||||
// sprawdzanie statusów zamówień w apilo.com jeżeli zamówienie nie jest zrealizowane, anulowane lub nieodebrane
|
// sprawdzanie statusów zamówień w apilo.com jeżeli zamówienie nie jest zrealizowane, anulowane lub nieodebrane
|
||||||
if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_settings['access-token'] and $apilo_settings['sync_orders_date_start'] <= date( 'Y-m-d H:i:s' ) )
|
if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_settings['access-token'] and $apilo_settings['sync_orders_date_start'] <= date( 'Y-m-d H:i:s' ) )
|
||||||
{
|
{
|
||||||
$order = $mdb -> query( 'SELECT id, apilo_order_id, apilo_order_status_date, number FROM pp_shop_orders WHERE apilo_order_id IS NOT NULL AND ( status != 6 AND status != 8 AND status != 9 ) AND ( apilo_order_status_date IS NULL OR apilo_order_status_date <= \'' . date( 'Y-m-d H:i:s', strtotime( '-30 minutes', time() ) ) . '\' ) ORDER BY apilo_order_status_date ASC LIMIT 1' ) -> fetch( \PDO::FETCH_ASSOC );
|
$orders = $mdb -> query( 'SELECT id, apilo_order_id, apilo_order_status_date, number FROM pp_shop_orders WHERE apilo_order_id IS NOT NULL AND ( status != 6 AND status != 8 AND status != 9 ) AND ( apilo_order_status_date IS NULL OR apilo_order_status_date <= \'' . date( 'Y-m-d H:i:s', strtotime( '-10 minutes', time() ) ) . '\' ) ORDER BY apilo_order_status_date ASC LIMIT 5' ) -> fetchAll( \PDO::FETCH_ASSOC );
|
||||||
|
foreach ( $orders as $order )
|
||||||
|
{
|
||||||
if ( $order['apilo_order_id'] )
|
if ( $order['apilo_order_id'] )
|
||||||
{
|
{
|
||||||
$access_token = \admin\factory\Integrations::apilo_get_access_token();
|
$access_token = \admin\factory\Integrations::apilo_get_access_token();
|
||||||
@@ -701,6 +703,7 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// sprawdzanie statusów zamówień w baselinker.com jeżeli zamówienie nie jest zrealizowane, anulowane lub nieodebrane
|
// sprawdzanie statusów zamówień w baselinker.com jeżeli zamówienie nie jest zrealizowane, anulowane lub nieodebrane
|
||||||
if ( $baselinker_settings['enabled'] and $baselinker_settings['sync_orders'] and $baselinker_settings['api_code'] and $baselinker_settings['sync_orders_date_start'] <= date( 'Y-m-d H:i:s' ) )
|
if ( $baselinker_settings['enabled'] and $baselinker_settings['sync_orders'] and $baselinker_settings['api_code'] and $baselinker_settings['sync_orders_date_start'] <= date( 'Y-m-d H:i:s' ) )
|
||||||
|
|||||||
Reference in New Issue
Block a user