Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion classes/Hook/HookDisplayBackOfficeHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected function processFailedOrders()
$failedOrders = Db::getInstance()->ExecuteS(
'SELECT DISTINCT o.id_order, g.sent FROM `' . _DB_PREFIX_ . 'orders` o
LEFT JOIN `' . _DB_PREFIX_ . GanalyticsRepository::TABLE_NAME . '` g ON o.id_order = g.id_order
WHERE (g.sent IS NULL OR g.sent = 0) AND o.date_add BETWEEN NOW() - INTERVAL ' . $backloadDays . ' DAY AND NOW() - INTERVAL 30 MINUTE'
WHERE (g.sent IS NULL OR g.sent = 0) AND o.date_add BETWEEN \'' . date('Y-m-d H:i:s', strtotime('-' . $backloadDays . ' days')) . '\' AND \'' . date('Y-m-d H:i:s', strtotime('-30 minutes')) . '\''
);

// Process each failed order
Expand Down
6 changes: 3 additions & 3 deletions classes/Repository/GanalyticsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function findAllByShopIdAndDateAdd($shopId)
FROM `' . _DB_PREFIX_ . self::TABLE_NAME . '`
WHERE sent = 0
AND id_shop = ' . (int) $shopId . '
AND DATE_ADD(date_add, INTERVAL 30 minute) < NOW()'
AND DATE_ADD(date_add, INTERVAL 30 minute) < \'' . date('Y-m-d H:i:s') . '\''
);
}

Expand Down Expand Up @@ -108,7 +108,7 @@ public function addOrder(int $idOrder, int $idShop)
'id_order' => (int) $idOrder,
'id_shop' => (int) $idShop,
'sent' => 0,
'date_add' => ['value' => 'NOW()', 'type' => 'sql'],
'date_add' => date('Y-m-d H:i:s'),
]
);
}
Expand Down Expand Up @@ -144,7 +144,7 @@ public function markOrderAsSent($idOrder)
return Db::getInstance()->update(
self::TABLE_NAME,
[
'date_add' => ['value' => 'NOW()', 'type' => 'sql'],
'date_add' => date('Y-m-d H:i:s'),
'sent' => 1,
],
'id_order = ' . (int) $idOrder
Expand Down
Loading