Commit 72a273f2506a621e0ed72929443c4eadfe99c871
1 parent
6d811d7c
Exists in
master
and in
1 other branch
filtros csv
Showing
1 changed file
with
6 additions
and
8 deletions
Show diff stats
src/Cacic/RelatorioBundle/Controller/FaturamentoController.php
| ... | ... | @@ -46,7 +46,6 @@ |
| 46 | 46 | array_push( $filtroLocais, $locais->getIdLocal() ); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - | |
| 50 | 49 | $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:LogAcesso') |
| 51 | 50 | ->pesquisar( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); |
| 52 | 51 | |
| ... | ... | @@ -74,17 +73,16 @@ |
| 74 | 73 | public function faturamentoCsvAction(Request $request) |
| 75 | 74 | { |
| 76 | 75 | |
| 77 | - $form = $this->createForm( new LogPesquisaType() ); | |
| 76 | + $dataInicio = $request->get('dtAcaoInicio'); | |
| 77 | + $dataFim = $request->get('dtAcaoFim'); | |
| 78 | 78 | |
| 79 | - $form->bind( $request ); | |
| 80 | - $data = $form->getData(); | |
| 81 | - $filtroLocais = array(); // Inicializa array com locais a pesquisar | |
| 82 | - foreach ( $data['idLocal'] as $locais ) { | |
| 83 | - array_push( $filtroLocais, $locais->getIdLocal() ); | |
| 79 | + $filtroLocais = $_POST; | |
| 80 | + | |
| 81 | + foreach ( $filtroLocais as $locais ) { | |
| 84 | 82 | } |
| 85 | 83 | |
| 86 | 84 | $printers = $this->getDoctrine()->getRepository( 'CacicCommonBundle:LogAcesso') |
| 87 | - ->faturamentoCsv( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); | |
| 85 | + ->faturamentoCsv( $dataInicio, $dataFim, $filtroLocais); | |
| 88 | 86 | |
| 89 | 87 | // Gera CSV |
| 90 | 88 | $reader = new ArrayReader($printers); | ... | ... |