From 3e9cf6284b9b47aadef229065b0c57ecd074f7dd Mon Sep 17 00:00:00 2001 From: "Claudio.Junior" Date: Thu, 23 May 2024 14:33:09 -0400 Subject: [PATCH] voltando o codigo novo --- .../cadastros/pesquisa/pesquisaFuncoes.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/www/html/aplicativo/cadastros/pesquisa/pesquisaFuncoes.php b/www/html/aplicativo/cadastros/pesquisa/pesquisaFuncoes.php index a18415f39..521b4317c 100644 --- a/www/html/aplicativo/cadastros/pesquisa/pesquisaFuncoes.php +++ b/www/html/aplicativo/cadastros/pesquisa/pesquisaFuncoes.php @@ -8,17 +8,15 @@ define("LOG_PATH", '/var/log/asterisk/relatorio_pesquisaRel.log'); function GetPesquisaRel($db, $plId, $matricula = null) { - file_put_contents(LOG_PATH, "\nGetPesquisaRel($plId)\n", FILE_APPEND); - $ret = ""; $sel = ""; //reduzi os filtros da query porque estava extremamente lenta, demorando 300 segundos para executar. - /* $query = "SELECT a.pl_id, pl_descricao, pl_data_inicio, pl_data_fim, b.pp_id, b.pp_nome + $query = "SELECT a.pl_id, pl_descricao, pl_data_inicio, pl_data_fim, b.pp_id, b.pp_nome FROM pbx_pesquisa_liberacao a INNER JOIN pbx_pesquisa b ON a.pp_id = b.pp_id - ORDER BY a.data_reg DESC"; */ + ORDER BY a.data_reg DESC"; //query antiga - $query = sprintf("SELECT DISTINCT a.pl_id, pl_descricao, pl_data_inicio, pl_data_fim, b.pp_id, b.pp_nome + /* $query = sprintf("SELECT DISTINCT a.pl_id, pl_descricao, pl_data_inicio, pl_data_fim, b.pp_id, b.pp_nome FROM pbx_pesquisa_liberacao a INNER JOIN pbx_pesquisa b ON a.pp_id = b.pp_id INNER JOIN pbx_pesquisa_movimento f ON a.pp_id = f.pp_id @@ -26,8 +24,8 @@ function GetPesquisaRel($db, $plId, $matricula = null) INNER JOIN pbx_grupo_usuario d ON d.user_id = c.id INNER JOIN pbx_fila_grupos e ON e.gp_id = d.gp_id WHERE EXISTS(SELECT '' FROM pbx_pesquisa_movimento WHERE pl_id = a.pl_id AND e.id = id_dac) - %s", $matricula ? "and c.matricula = '$matricula'" : ""); - $query .= " ORDER BY b.pp_nome"; + %s", $matricula ? "and c.matricula = '$matricula'" : ""); */ + //$query .= " ORDER BY b.pp_nome"; $result = pg_query($db, $query); if (!$plId) {