Skip to content
Snippets Groups Projects
Commit 53c76d68 authored by Hamer Iboshi's avatar Hamer Iboshi
Browse files

Added last filter of biblioteca/sala_leitura/biblioteca_sala_leitura

parent e22f1e79
No related branches found
No related tags found
3 merge requests!116Release v1.0.0,!47School number count,!44Feature multiple where
Pipeline #
...@@ -488,18 +488,18 @@ rqfCount.addField({ ...@@ -488,18 +488,18 @@ rqfCount.addField({
field: 'local_func_predio_escolar' field: 'local_func_predio_escolar'
} }
}).addValue({ }).addValue({
name: 'library_and_reading_room', name: 'library_or_reading_room',
table: 'escola', table: 'escola',
tableField: ['biblioteca', 'sala_leitura', 'biblioteca_sala_leitura'], tableField: ['biblioteca', 'sala_leitura', 'biblioteca_sala_leitura'],
resultField: 'library_and_reading_room', resultField: 'library_or_reading_room',
where: { where: {
relation: '=', relation: '=',
type: 'boolean', type: 'boolean',
condition: 'or', condition: 'or',
field: 'local_func_predio_escolar' field: ['biblioteca', 'sala_leitura', 'biblioteca_sala_leitura']
} }
}); });
// SELECT COUNT(escola.id) AS "total", 'Brasil' AS "name", escola.ano_censo AS "year" FROM escola WHERE (escola.biblioteca = ? OR escola.sala_leitura = ? OR escola.biblioteca_sala_leitura) AND (escola.situacao_de_funcionamento = 1 AND escola.ensino_regular = 1) GROUP BY escola.ano_censo ORDER BY escola.ano_censo ASC
schoolApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => { schoolApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
console.log(req.filter); console.log(req.filter);
if(typeof req.filter === 'undefined' || Object.keys(req.filter).length === 0) { if(typeof req.filter === 'undefined' || Object.keys(req.filter).length === 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment