symfony - Symfony2/Doctrine QueryBuilder multiple andwhere() fail -
bonjour,
i having problem simple request querybuilder :
$query->where('ec.codemodeprelevement in (:cbmode)') ->setparameter('cbmode', $modes) ->andwhere('ec.idstatuspaiement = :status') ->setparameter('status', echeancesstatut::__en_attente_paiement__) ->andwhere($query->expr()->eq('ec.idproduit',1)) ->andwhere('ec.idproduit = :idproduit') ->setparameter('idproduit', 1 ) ;
this return me no result if in database no user corresponding : user status = 1 codeproduit = 1 , modepaiement = vm or vmmano. ihave verified possible mistakes of typo. , users corresponding in database exist.
i have tried remove id produit filter "works" have result:
$modes = array('vm','vmmano'); $query->where('ec.codemodeprelevement in (:cbmode)') ->setparameter('cbmode', $modes) ->andwhere('ec.idstatuspaiement = :status') ->setparameter('status', echeancesstatut::__en_attente_paiement__) /*->andwhere('ec.idproduit = :idproduit') ->setparameter('idproduit', 1 )*/ ;
this "works" (removing modepaiement filter):
$query/*->where('ec.codemodeprelevement in (:cbmode)') ->setparameter('cbmode', $modes)*/ ->where('ec.idstatuspaiement = :status') ->setparameter('status', echeancesstatut::__en_attente_paiement__) ->andwhere('ec.idproduit = :idproduit') ->setparameter('idproduit', 1 ) ;
but returns me no result (removing status payment filter) :
$query->where('ec.codemodeprelevement in (:cbmode)') ->setparameter('cbmode', $modes) /*->where('ec.idstatuspaiement = :status') ->setparameter('status', echeancesstatut::__en_attente_paiement__)*/ ->andwhere('ec.idproduit = :idproduit') ->setparameter('idproduit', 1 ) ;
can me if see don't? thank you.
wiki
Comments
Post a Comment