From d04b3abc4eedb7b7966ca90a6b1c99f8ffc586c8 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 28 Oct 2016 15:16:57 +0200 Subject: [PATCH] Batch RRG : Correction format date --- bin/clientRrgSurv.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/bin/clientRrgSurv.php b/bin/clientRrgSurv.php index ad7c5414..20ceac1f 100644 --- a/bin/clientRrgSurv.php +++ b/bin/clientRrgSurv.php @@ -98,15 +98,21 @@ $execId = $execRef->start(); $dateStart = new DateTime(); $dateEnd = new DateTime(); if ($opts->since == 'flux') { - $fluxoutM = new Application_Model_Sdv1FluxFileOut(); - $sql = $fluxoutM->select() - ->where('client=?', 'rrg') - ->where('name=?', 'HEXAVIA') - ->where('fileOut LIKE ?', 'surv_%') - ->where('depotDate!=?', '0000-00-00 00:00:00') - ->order('depotDate DESC')->limit(1); - $resultDate = $fluxoutM->fetchRow($sql); - $dateStart = DateTime::createFromFormat('YmdHis', $resultDate->dateEnd); + try { + $fluxoutM = new Application_Model_Sdv1FluxFileOut(); + $sql = $fluxoutM->select() + ->where('client=?', 'rrg') + ->where('name=?', 'HEXAVIA') + ->where('fileOut LIKE ?', 'surv_%') + ->where('depotDate!=?', '0000-00-00 00:00:00') + ->order('depotDate DESC')->limit(1); + $resultDate = $fluxoutM->fetchRow($sql); + } + catch(Zend_Db_Exception $e) { + echo "Erreur"; + exit; + } + $dateStart = DateTime::createFromFormat('Y-m-d H:i:s', $resultDate->dateEnd); } elseif ($opts->since) { $dateStart = DateTime::createFromFormat('Ymd', $opts->since); } else {