refs #6210 Refactor filter client (zoneFk)
This commit is contained in:
parent
a6b730ecc2
commit
661563a2b6
|
@ -80,10 +80,15 @@ module.exports = Self => {
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
if (args.zoneFk) {
|
if (args.zoneFk) {
|
||||||
query = `CALL vn.zone_getPostalCode(?)`;
|
let stmts = [];
|
||||||
const [geos] = await Self.rawSql(query, [args.zoneFk]);
|
stmts.push(new ParameterizedSQL('CALL vn.zone_getPostalCode(?)', [ args.zoneFk]));
|
||||||
for (let geo of geos)
|
stmts.push(`SELECT name FROM tmp.zoneNodes`);
|
||||||
postalCode.push(geo.name);
|
stmts.push(`DROP TEMPORARY TABLE IF EXISTS tmp.zoneNodes`);
|
||||||
|
const sql = ParameterizedSQL.join(stmts, ';');
|
||||||
|
const [results] = await conn.executeStmt(sql);
|
||||||
|
|
||||||
|
for (let result of results)
|
||||||
|
postalCode.push(result.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const where = buildFilter(ctx.args, (param, value) => {
|
const where = buildFilter(ctx.args, (param, value) => {
|
||||||
|
|
Loading…
Reference in New Issue