From b56a55c1d0259ffffe60931e53ae4bdb7ce5c14d Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Thu, 28 Jul 2016 17:23:06 +0200 Subject: [PATCH 1/2] Controle existence fichier --- scripts/jobs/enrichissement.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/jobs/enrichissement.php b/scripts/jobs/enrichissement.php index 105a5608..8ad64dfb 100644 --- a/scripts/jobs/enrichissement.php +++ b/scripts/jobs/enrichissement.php @@ -159,6 +159,10 @@ foreach ( $dataProfil as $item ) { $outFile = $profil->login.'_'.$id.'_'.date('YmdHis').'.csv'; $fp = fopen($path.'/'.$outFile, 'w'); +if ($fp === false) { + echo "Error ".$path."/".$outFile."\n"; exit; +} + // --- Ecrire l'entete if ( count($tabEnteteLabel) > 0 ) { fputcsv($fp, $tabEnteteLabel, ',', '"'); From fbadbb691ad20db616560ae4a77de04640fba28f Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Thu, 19 Jan 2017 12:17:18 +0100 Subject: [PATCH 2/2] Correction date crea etab ent immat --- library/Scores/Enrichissement.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/library/Scores/Enrichissement.php b/library/Scores/Enrichissement.php index 0e52bb21..a3620e06 100644 --- a/library/Scores/Enrichissement.php +++ b/library/Scores/Enrichissement.php @@ -91,17 +91,20 @@ class Enrichissement 'creaetab' => array( 'label' => "Date de création de l'établissement", 'column' => 'dateCrea_etab', - 'sql' => "IF(dateCrea_etab = 0,'',CONCAT_WS('-',SUBSTRING(dateCrea_etab,0,4),SUBSTRING(dateCrea_etab,4,2),SUBSTRING(dateCrea_etab,6,2))) AS creaetab", + 'sql' => "IF(dateCrea_etab = 0, '', CONCAT_WS('-', + SUBSTR(dateCrea_etab,1,4), SUBSTR(dateCrea_etab,5,2), SUBSTR(dateCrea_etab,7,2))) AS creaetab", ), 'creaent' => array( 'label' => "Date de création de l'entreprise", 'column' => 'dateCrea_ent', - 'sql' => "IF(dateCrea_ent=0,'',CONCAT_WS('-',SUBSTRING(dateCrea_ent,0,4),SUBSTRING(dateCrea_ent,4,2),SUBSTRING(dateCrea_ent,6,2))) AS creaent", + 'sql' => "IF(dateCrea_ent=0, '', CONCAT_WS('-', + SUBSTR(dateCrea_ent,1,4), SUBSTR(dateCrea_ent,5,2), SUBSTR(dateCrea_ent,7,2))) AS creaent", ), 'dateimmat' => array( 'label' => "Date d'immatriculation de l'entreprise", 'column' => 'dateImmat', - 'sql' => "IF(dateImmat=0,'',CONCAT_WS('-',SUBSTRING(dateImmat,0,4),SUBSTRING(dateImmat,4,2),SUBSTRING(dateImmat,6,2))) AS dateImmat", + 'sql' => "IF(dateImmat=0, '', CONCAT_WS('-', + SUBSTR(dateImmat,1,4), SUBSTR(dateImmat,5,2), SUBSTR(dateImmat,7,2))) AS dateImmat", ), 'cj' => array( 'label' => "Code Forme juridique",