24 lines
569 B
JavaScript
24 lines
569 B
JavaScript
const con = require('./connect')
|
|
|
|
//ticket
|
|
//cliente
|
|
//agencia
|
|
|
|
function select(collectionFk){
|
|
con.con.connect(function(err) {
|
|
let consSql = `SELECT t.id, t.clientFk, am.name
|
|
FROM ticketCollection tc
|
|
JOIN ticket t ON t.id = tc.ticketFk
|
|
JOIN agencyMode am ON am.id = t.agencyModeFk
|
|
WHERE tc.collectionFk = ${collectionFk}`;
|
|
if (err) throw err;
|
|
con.con.query(consSql, function (err, result, fields) {
|
|
if (err) throw err;
|
|
console.log(result);
|
|
});
|
|
});
|
|
}
|
|
|
|
exports.select = select;
|
|
|