Skip to content
Snippets Groups Projects
Commit 8ad7013f authored by Fernando Erd's avatar Fernando Erd :ok_hand:
Browse files

Add filter integral time in class.js

parent 92236153
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!41Add filter integral time in class.js
Pipeline #
......@@ -58,6 +58,15 @@ classApp.get('/period', (req, res, next) => {
next();
}, query, response('period'));
// Returns integral-time avaible
classApp.get('/integral_time', (req, res, next) => {
req.result = [
{id: 0, name: 'Não'},
{id: 1, name: 'Sim'}
];
next();
}, response('integral_time'));
// Returns all educational levels avaible
classApp.get('/education_level', (req, res, next) => {
req.sql.from('etapas_mod_ensino_segmento')
......@@ -191,6 +200,16 @@ rqfCount.addField({
type: 'integer',
field: 'turma_turno_id'
}
}).addValue({
name:'integral_time',
table: 'turma',
tableField: 'tempo_integral',
resultField: 'integral_time_name',
where: {
relation: '=',
type: 'boolean',
field: 'tempo_integral'
}
}).addValue({
name: 'school',
table: 'escola',
......
  • Author Guest

    @vsbc14, estou tendo dificuldades ao adicionar o filtro que faltava no indicador de número de turmas, se conseguir dar uma olhada.

  • Author Guest

    Filtro - Tempo Integral

    Exemplo de Consulta - http://localhost:3000/api/v1/class?filter=integral_time:0

    Log:

    error: [db/query_exec.js] SQL query: SELECT COUNT(turma.id) AS "total", 'Brasil' AS "name", turma.ano_censo AS "year" FROM turma WHERE (turma.tempo_integral = ? ) AND (turma.tipo_turma_id = 0 OR turma.tipo_turma_id = 1 OR turma.tipo_turma_id = 2 OR turma.tipo_turma_id = 3) GROUP BY turma.ano_censo ORDER BY turma.ano_censo ASC with params: 1 error: [middlewares/query.js] Error: 07001!EXEC: wrong type for argument 1 of prepared statement: char, expected boolean

  • Guest

    Talvez ele esteja escrevendo o 1 como char e colocando entre aspas na consulta. Vou dar uma olhada no RQF pra ver o que está acontecendo

  • Guest

    @fce15, você lembra quem tinha feito o campo boolean? A alteração não está na branch development. Quando ela estiver, a consulta deve funcionar

    Edited by Vytor Calixto
  • Guest

    @fce15 Testei aqui, você deve fazer fazer o cherry pick do commit 38862797 para ter a funcionalidade do boolean

    Edited by Vytor Calixto
  • Author Guest

    @vsbc14 feito, obrigado.

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