Commit bf094eae3d6de5709e208584507886bfbc6e8cd2

Authored by Starlone Passos
1 parent d24f39b6

Correção na coleta do indicador de extensoes de arquivos

Showing 1 changed file with 5 additions and 3 deletions   Show diff stats
rn/MdEstatisticasColetarRN.php
... ... @@ -162,7 +162,9 @@ class MdEstatisticasColetarRN extends InfraRN
162 162 $extensoes = array();
163 163 // Calculando na aplicacao para funcionar independente do banco
164 164 foreach ($rs as $r) {
165   - $extensao = pathinfo($r['nome'], PATHINFO_EXTENSION);
  165 + /* $extensao = pathinfo($r['nome'], PATHINFO_EXTENSION); */
  166 + $extensao = end(explode('.', $r['nome']));
  167 + $extensao = utf8_encode($extensao);
166 168 $qtd = $extensoes[$extensao];
167 169 if (! $qtd) {
168 170 $qtd = 0;
... ... @@ -379,7 +381,7 @@ class MdEstatisticasColetarRN extends InfraRN
379 381 } elseif ($sgbd == 'Oracle') {
380 382 $query = "select count(*) as quantidade, to_char(dth_acesso,'YYYY-MM-DD') AS data from infra_navegador where dth_acesso >= date '%s' group by to_char(dth_acesso,'YYYY-MM-DD')";
381 383 }
382   -
  384 +
383 385 $rs = array();
384 386 if ($query) {
385 387 $query = sprintf($query, $ultimadata);
... ... @@ -443,7 +445,7 @@ class MdEstatisticasColetarRN extends InfraRN
443 445 if ($sgbd == 'MySql') {
444 446 $query = "SELECT year(dth_acesso) as ano, month(dth_acesso) as mes, recurso, count(*) as quantidade FROM sei.infra_auditoria where date(dth_acesso) > '%s' and date(dth_acesso) < '%s' group by 1, 2, 3 order by 1, 2, 3";
445 447 } elseif ($sgbd == 'SqlServer') {
446   - $query = "SELECT year(dth_acesso) as ano, month(dth_acesso) as mes, recurso, count(*) as quantidade FROM infra_auditoria where dth_acesso > '%s' and dth_acesso < '%s' group by year(dth_acesso), month(dth_acesso), recurso order by 1, 2, 3";
  448 + $query = "SELECT year(dth_acesso) as ano, month(dth_acesso) as mes, recurso, count(*) as quantidade FROM infra_auditoria where dth_acesso > '%s' and dth_acesso < '%s' group by year(dth_acesso), month(dth_acesso), recurso order by 1, 2, 3";
447 449 } elseif ($sgbd == 'Oracle'){
448 450 $query = "SELECT to_char(dth_acesso, 'YYYY') AS ano, to_char(dth_acesso, 'MM') AS mes, recurso, count(*) as quantidade FROM sei.infra_auditoria WHERE dth_acesso > date '%s' AND dth_acesso < date '%s' GROUP BY to_char(dth_acesso, 'YYYY'), to_char(dth_acesso, 'MM'), recurso";
449 451 }
... ...