Commit bf094eae3d6de5709e208584507886bfbc6e8cd2
1 parent
d24f39b6
Exists in
master
and in
1 other branch
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,7 +162,9 @@ class MdEstatisticasColetarRN extends InfraRN | ||
162 | $extensoes = array(); | 162 | $extensoes = array(); |
163 | // Calculando na aplicacao para funcionar independente do banco | 163 | // Calculando na aplicacao para funcionar independente do banco |
164 | foreach ($rs as $r) { | 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 | $qtd = $extensoes[$extensao]; | 168 | $qtd = $extensoes[$extensao]; |
167 | if (! $qtd) { | 169 | if (! $qtd) { |
168 | $qtd = 0; | 170 | $qtd = 0; |
@@ -379,7 +381,7 @@ class MdEstatisticasColetarRN extends InfraRN | @@ -379,7 +381,7 @@ class MdEstatisticasColetarRN extends InfraRN | ||
379 | } elseif ($sgbd == 'Oracle') { | 381 | } elseif ($sgbd == 'Oracle') { |
380 | $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')"; | 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 | $rs = array(); | 385 | $rs = array(); |
384 | if ($query) { | 386 | if ($query) { |
385 | $query = sprintf($query, $ultimadata); | 387 | $query = sprintf($query, $ultimadata); |
@@ -443,7 +445,7 @@ class MdEstatisticasColetarRN extends InfraRN | @@ -443,7 +445,7 @@ class MdEstatisticasColetarRN extends InfraRN | ||
443 | if ($sgbd == 'MySql') { | 445 | if ($sgbd == 'MySql') { |
444 | $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"; | 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 | } elseif ($sgbd == 'SqlServer') { | 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 | } elseif ($sgbd == 'Oracle'){ | 449 | } elseif ($sgbd == 'Oracle'){ |
448 | $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"; | 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 | } |