Merge pull request '#6557 replace getSubordinates for WorkerGetHierach' (!1952) from 6557-useWorkerGetHierarch into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1952
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Jorge Penadés 2024-02-05 08:10:44 +00:00
commit 13021180e1
1 changed files with 3 additions and 4 deletions

View File

@ -30,13 +30,12 @@ module.exports = Self => {
if (typeof options == 'object')
Object.assign(myOptions, options);
stmts.push(new ParameterizedSQL('CALL vn.subordinateGetList(?)', [userId]));
const queryIndex = stmts.push('SELECT * FROM tmp.subordinate') - 1;
stmts.push('DROP TEMPORARY TABLE tmp.subordinate');
stmts.push(new ParameterizedSQL('CALL vn.worker_getHierarchy(?)', [userId]));
const queryIndex = stmts.push('SELECT * FROM tmp.workerHierarchyList') - 1;
stmts.push('DROP TEMPORARY TABLE tmp.workerHierarchyList');
const sql = ParameterizedSQL.join(stmts, ';');
const result = await conn.executeStmt(sql, myOptions);
return result[queryIndex];
};
};