Correction requete ou

This commit is contained in:
Michael RICOIS 2010-04-22 07:30:24 +00:00
parent ccb98bdbb9
commit cb7399f7f2

View File

@ -234,7 +234,7 @@ function commandesListe($type, $etat, $date, $mode = ''){
} }
if ($mode!='-'){ if ($mode!='-'){
if ($mode == 'G') { if ($mode == 'G') {
$q->orWhereIn('typeCommande', array('', $mode)); $q->andWhereIn('typeCommande', array('', $mode));
} else { } else {
$q->andWhere('typeCommande = ?', $mode); $q->andWhere('typeCommande = ?', $mode);
} }
@ -242,7 +242,8 @@ function commandesListe($type, $etat, $date, $mode = ''){
if (!hasModeEdition()){ if (!hasModeEdition()){
$q->andWhere('login = ?', $_SESSION['tabInfo']['login']); $q->andWhere('login = ?', $_SESSION['tabInfo']['login']);
} }
FB::log($q->getSqlQuery(), 'QUERY');
FB::log($q->getFlattenedParams(), 'PARAMS');
//Résultat //Résultat
$commandes = $q->execute(); $commandes = $q->execute();
@ -250,7 +251,6 @@ function commandesListe($type, $etat, $date, $mode = ''){
$outputCommandes = array(); $outputCommandes = array();
if($type!='-' && count($commandes)>0){ if($type!='-' && count($commandes)>0){
foreach ($commandes as $commande){ foreach ($commandes as $commande){
FB::log($commande->refDocument, 'ref');
if (filtreTypeCommande($type, $commande->refDocument)){ if (filtreTypeCommande($type, $commande->refDocument)){
$outputCommandes[] = $commande; $outputCommandes[] = $commande;
} }