21 lines
542 B
JavaScript
21 lines
542 B
JavaScript
const con = require('./connect')
|
|
|
|
|
|
module.exports = function (collectionFk, callback){
|
|
let consSql = `SELECT t.id AS Ticket, c.name AS Client, am.name AS Agency, tc.level AS Level
|
|
FROM ticketCollection tc
|
|
JOIN ticket t ON t.id = tc.ticketFk JOIN client c ON t.clientFk = c.id
|
|
JOIN agencyMode am ON am.id = t.agencyModeFk
|
|
WHERE tc.collectionFk = ${collectionFk}`;
|
|
|
|
con.con.query(consSql, function (err, result, fields) {
|
|
console.log(result);
|
|
callback(null,result);
|
|
});
|
|
}
|
|
|
|
console.log("PROBA");
|
|
|
|
|
|
|