Skip to content
Snippets Groups Projects
Commit 3662081d authored by Fernando Gbur dos Santos's avatar Fernando Gbur dos Santos
Browse files

[FIX] Fixing instruction level convert and region filter

parent 554b3e4c
No related branches found
No related tags found
3 merge requests!391Hom -> Prod,!388development -> homologa,!387new_pnad -> development
...@@ -34,7 +34,7 @@ module.exports = function instructionLevel(id) { ...@@ -34,7 +34,7 @@ module.exports = function instructionLevel(id) {
return 'Superior incompleto ou equivalente'; return 'Superior incompleto ou equivalente';
case 7: case 7:
return 'Superior completo ou equivalente'; return 'Superior completo ou equivalente';
case 8: case 99:
return 'Não se aplica - 17 anos ou menos'; return 'Não se aplica - 17 anos ou menos';
} }
}; };
...@@ -465,23 +465,17 @@ rqf.addField({ ...@@ -465,23 +465,17 @@ rqf.addField({
type: 'integer', type: 'integer',
field: 'microrregiao_id' field: 'microrregiao_id'
} }
}).addValueToField({ }).addValue({
name: 'region', name: 'region',
table: 'estado', table: 'pnad_novo',
tableField: 'regiao_id', tableField: 'cod_regiao',
resultField: 'region_id', resultField: 'reg_code_id',
where: { where: {
relation: '=', relation: '=',
type: 'integer', type: 'integer',
field: 'regiao_id', field: 'cod_regiao',
table: 'estado'
},
join: {
primary: 'id',
foreign: 'estado_id',
foreignTable: 'municipio'
} }
}, 'filter'); });
PnadNovoApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => { PnadNovoApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.sql.from('pnad_novo') req.sql.from('pnad_novo')
......
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