From 0f89c1b1d0b515cc7b011ae6afc2f16a9b01b3f0 Mon Sep 17 00:00:00 2001 From: Vytor Calixto <vytorcalixto@gmail.com> Date: Mon, 3 Jul 2017 11:56:28 -0300 Subject: [PATCH] Fix RQF in school --- src/libs/routes/school.js | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/libs/routes/school.js b/src/libs/routes/school.js index d5f4c380..5320c29f 100644 --- a/src/libs/routes/school.js +++ b/src/libs/routes/school.js @@ -335,23 +335,7 @@ rqf.addField({ type: 'integer', field: 'id' } -}).addValueToField({ - name: 'city', - table: 'municipio', - tableField: ['nome', 'id'], - resultField: ['city_name', 'city_id'], - where: { - relation: '=', - type: 'integer', - field: 'municipio_id', - table: 'escola' - }, - join: { - primary: 'id', - foreign: 'municipio_id', - foreignTable: 'escola' - } -}, 'dims').addValueToField({ +}).addValue({ name: 'city', table: 'municipio', tableField: 'nome', @@ -367,7 +351,7 @@ rqf.addField({ foreign: 'municipio_id', foreignTable: 'escola' } -}, 'filter').addValue({ +}).addValue({ name: 'state', table: 'estado', tableField: 'nome', @@ -413,7 +397,23 @@ rqfCount.addField({ type: 'integer', field: 'id' } -}).addValue({ +}).addValueToField({ + name: 'city', + table: 'municipio', + tableField: ['nome', 'id'], + resultField: ['city_name', 'city_id'], + where: { + relation: '=', + type: 'integer', + field: 'municipio_id', + table: 'escola' + }, + join: { + primary: 'id', + foreign: 'municipio_id', + foreignTable: 'escola' + } +}, 'dims').addValueToField({ name: 'city', table: 'municipio', tableField: 'nome', @@ -429,7 +429,7 @@ rqfCount.addField({ foreign: 'municipio_id', foreignTable: 'escola' } -}).addValue({ +}, 'filter').addValue({ name: 'state', table: 'estado', tableField: 'nome', -- GitLab