diff --git a/library/Metier/insee/classMInsee.php b/library/Metier/insee/classMInsee.php index c4393c2c..681fbdd1 100644 --- a/library/Metier/insee/classMInsee.php +++ b/library/Metier/insee/classMInsee.php @@ -4646,30 +4646,32 @@ TOTAL : $dureeTot s\n"; * @param string $siren * @param string $type A:avis d'attribution, M:Avis de marché */ - public function getAnnoncesBoampCount($siren, $type='A') + public function getAnnoncesBoampCount($siren, $type='') { - $bodacc = array(); - if ( $type=='A' ) { + $bodaccA = array(); + $bodaccM = array(); + if ( $type=='' || $type=='A' ) { /** Recherche dans les avis d'attribution **/ - $bodacc=$this->iDb->select( + $bodaccA=$this->iDb->select( 'boamp_lots l, boamp b, boamp_detail d', "l.id", "l.siren='$siren' AND l.idAnn=b.id AND l.idAnn=d.id GROUP BY b.id ORDER BY l.Boamp_Date_Parution", false, MYSQL_ASSOC ); - } elseif ( $type=='M') { + } + if ( $type=='' || $type=='M') { /** Recherche dans les avis de marchés **/ - $bodacc=$this->iDb->select( 'boamp b, boamp_detail d', + $bodaccM=$this->iDb->select( 'boamp b, boamp_detail d', "d.id", "d.siren='$siren' AND d.id=b.id GROUP BY b.id ORDER BY d.Boamp_Date_Parution DESC", false, MYSQL_ASSOC ); } - $nb = count($bodacc); + $nb = count($bodaccA) + count($bodaccM); return $nb; }