Skip to content
Snippets Groups Projects
Commit 38862797 authored by Gabriel Ruschel's avatar Gabriel Ruschel
Browse files

Add type boolean to query fields

parent 12b0b4f8
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!47School number count
Pipeline #
......@@ -223,6 +223,7 @@ class ReqQueryFields {
if(value.where.type === 'integer') whereValue = parseInt(whereValue, 10);
if(value.where.type === 'double') whereValue = parseFloat(whereValue);
if(value.where.type === 'string') whereValue = '%'+whereValue+'%';
if(value.where.type === 'boolean') whereValue = (whereValue.toLowerCase() === 'true' || parseInt(whereValue, 10) === 1);
let tbl = value.where.table || value.table;
let whereField = (value.where.type === 'string')? 'LOWER('+tbl+'.'+value.where.field+')' : tbl+'.'+value.where.field;
let lower = (value.where.type === 'string') ? ' LOWER(?) ' : ' ? ';
......
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