symfony - How I can Iterate into SUM result from doctrine query -


i need iterate on result in doctrine. code query:

$consulta = $em->createquery(' select bcr, sum(bcr.volumenalmacenado) vol, sum(bcr.pesoalmacenado) pes  residuobundle:bodegacontieneresiduo bcr  bcr.fechaingreso between :fechap , :fechaa , bcr.fecharetiro null  group bcr.idresiduo ');          $consulta->setparameter('fechaa', $fechaactual);         $consulta->setparameter('fechap', $fechapasada);         return $consulta->getresult(); 

when run in mysql return without problem. in symfony results. now, when tried loop in twig can't do, think agregate functions in query. hope can me clue or this. grettings

you should added extension of mysql function sum can use sum function in doctrine query way can direct execute query or native query of doctrine try following query can result

$consulta = $em->executequery('select bcr, sum(bcr.volumenalmacenado) vol, sum(bcr.pesoalmacenado) pes residuobundle:bodegacontieneresiduo bcr bcr.fechaingreso between :fechap , :fechaa , bcr.fecharetiro null group bcr.idresiduo'),          array('fechaa'=> $fechaactual, 'fechap' => $fechapasada));         return $consulta->fetchall(); 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -