🚑 Corrige la condition de suppression

This commit is contained in:
Shikiryu 2017-11-26 23:06:09 +01:00
parent 25f603f4a9
commit 7eb44f43a0

View File

@ -56,7 +56,7 @@ if ($actions->connect()) {
if (in_array($deal->getId(), array_keys($existing_deals))) {
$log->info(sprintf('L\'annonce %s existe déjà, ', $deal->getId()));
// si elle est vieille, on supprime et on recréé
if ($existing_deals[$deal->getId()]->getDateCreation()->add(new DateInterval('P1W')) <= (new DateTime())) {
if ($existing_deals[$deal->getId()]->getDateCreation()->add(new DateInterval('P1W')) >= (new DateTime())) {
// Suppression
$log->error(sprintf('elle est vieille (%s), on la supprime.', $existing_deals[$deal->getId()]->getDateCreation()->format('d/m/Y H:i')));
$actions->delete($deal);