diff --git a/scripts/jobs/enrichissement.php b/scripts/jobs/enrichissement.php index 364c8795..d783f740 100644 --- a/scripts/jobs/enrichissement.php +++ b/scripts/jobs/enrichissement.php @@ -1998,12 +1998,12 @@ function etablissementlisteMultiple($siren, $nic, $values = false) $mInsee = new MInsee($iDb); $result = $mInsee->getEtablissements($siren); $tabData = array(); - if (count($result) > 0) { - foreach ($result as $r) { + if (count($result['reponses']) > 0) { + foreach ($result['reponses'] as $r) { $tabData[] = array( - 'etabSIRET' => $result['Siret'], - 'etabSIEGE' => $result['Siege'], - 'etabACTIF' => $result['Actif'], + 'etabSIRET' => $r['Siret'], + 'etabSIEGE' => $r['Siege'], + 'etabACTIF' => $r['Actif'], ); } }