Skip to content
Snippets Groups Projects
Commit 9346bffa authored by Pietro Cavassin's avatar Pietro Cavassin
Browse files

Add region and state not filter

parent 5bed3d9f
No related branches found
No related tags found
4 merge requests!335Homologa,!334Dev,!330Add region and state not filter,!309Merge new updates into master
......@@ -69,6 +69,22 @@ rqf.addField({
foreign: 'estado_id',
foreignTable: 'municipio'
}
}).addValue({
name: 'state_not',
table: 'estado',
tableField: ['nome', 'id'],
resultField: ['state_name', 'state_id'],
where: {
relation: '<>',
type: 'integer',
field: 'estado_id',
table: 'municipio'
},
join: {
primary: 'id',
foreign: 'estado_id',
foreignTable: 'municipio'
}
}).addField({
name: 'search',
field: false,
......@@ -100,7 +116,23 @@ rqf.addField({
type: 'integer',
field: 'microrregiao_id'
}
});
}).addValueToField({
name: 'region',
table: 'estado',
tableField: 'regiao_id',
resultField: 'region_id',
where: {
relation: '=',
type: 'integer',
field: 'regiao_id',
table: 'estado'
},
join: {
primary: 'id',
foreign: 'estado_id',
foreignTable: 'municipio'
}
}, 'filter');
// Return all cities
cityApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
......
......@@ -36,6 +36,16 @@ rqf.addField({
field: 'id',
table: '@'
}
}).addValue({
name: 'id_not',
table: '@',
tableField: 'id',
where: {
relation: '<>',
type: 'integer',
field: 'id',
table: '@'
}
}).addField({
name: 'search',
field: false,
......
......@@ -53,6 +53,15 @@ rqf.addField({
type: 'integer',
field: 'id'
}
}).addValue({
name: 'id_not',
table: 'estado',
tableField: 'id',
where: {
relation: '<>',
type: 'integer',
field: 'id'
}
}).addValue({
name: 'region',
table: 'regiao',
......
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