From 0e2903093088f9bc337baa2674db4ee66da1b141 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 29 Apr 2015 09:50:32 +0000 Subject: [PATCH] =?UTF-8?q?Correction=20retour=20privil=C3=A8ges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/jobs/enrichissement.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/jobs/enrichissement.php b/scripts/jobs/enrichissement.php index 72ef9582..7718e744 100644 --- a/scripts/jobs/enrichissement.php +++ b/scripts/jobs/enrichissement.php @@ -1444,8 +1444,10 @@ function privilegeData($siren, $nic, $values = false) $iDb = new WDB('sdv1'); $sql = "SELECT count(*) AS nbPriv FROM ge_cs2 WHERE cs = 'P' AND dateFin >= NOW() AND dateSuppr=0 AND siren='$siren';"; $ret = $iDb->query($sql); - if ($ret['nbPriv']>0) { - $return = 'Oui'; + if (count($ret) > 0) { + if ($ret[0]['nbPriv']>0) { + $return = 'Oui'; + } } } $tabData['privilege'] = $return;