Batch RRG : Correction format date

This commit is contained in:
Michael RICOIS 2016-10-28 15:16:57 +02:00
parent 7bd12f7607
commit d04b3abc4e

View File

@ -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 {