diff --git a/src/libs/middlewares/reqQueryFields.js b/src/libs/middlewares/reqQueryFields.js index 7f4a1399e1369350d1b8b1b383e70bd7918e5fed..adb70826f7c2470db031dc2ee900b3ea020a5e1f 100644 --- a/src/libs/middlewares/reqQueryFields.js +++ b/src/libs/middlewares/reqQueryFields.js @@ -265,7 +265,7 @@ class ReqQueryFields { let tbl = value.where.table || value.table; if (tbl === '@') tbl = thisTable; - // multiple where, only tested for boolean fields + // multiple where if (Array.isArray(value.where.field)) { let lower = (value.where.type === 'string') ? ' LOWER(?) ' : ' ? '; let whereField = ''; diff --git a/src/libs/routes/teacher.js b/src/libs/routes/teacher.js index 738b34140c13127209f6ae001185242c032e41b7..be9842a44e7803f3e442075fb6d636bb7b8d2ae6 100644 --- a/src/libs/routes/teacher.js +++ b/src/libs/routes/teacher.js @@ -353,7 +353,8 @@ teacherApp.get('/', rqf.parse(), (req, res, next) => { req.hadEducationLevelMod = true; req.sql.field('docente.etapas_mod_ensino_segmento_id', 'education_level_mod_id') .where('docente.etapas_mod_ensino_segmento_id < 11') - .group('docente.etapas_mod_ensino_segmento_id'); + .group('docente.etapas_mod_ensino_segmento_id') + .order('docente.etapas_mod_ensino_segmento_id'); } next();