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

fix range_year

parent 8db3f170
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!48fix range_year
Pipeline #
......@@ -18,6 +18,13 @@ let rqf = new ReqQueryFields();
let rqfCount = new ReqQueryFields();
// Return location
schoolApp.get('/year_range', (req, res, next) => {
req.sql.from('escola')
.field('MIN(escola.ano_censo)', 'start_year')
.field('MAX(escola.ano_censo)', 'end_year');
next();
}, query, response('range'));
schoolApp.get('/location', (req, res, next) => {
req.result = [
{id: 1, name: 'Urbana'},
......@@ -767,6 +774,26 @@ rqfCount.addField({
condition: 'or',
field: 'biblioteca_sala_leitura'
}
}).addValue({
name: 'min_year',
table: 'escola',
tableField: 'ano_censo',
resultField: 'year',
where: {
relation: '>=',
type: 'integer',
field: 'ano_censo'
}
}).addValue({
name: 'max_year',
table: 'escola',
tableField: 'ano_censo',
resultField: 'year',
where: {
relation: '<=',
type: 'integer',
field: 'ano_censo'
}
});
// .addValue({ //Using multiple_where
......
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