This repository has been archived on 2024-10-02. You can view files and clone it, but cannot push or open issues or pull requests.
smart-tag/db/selectDB.js

24 lines
569 B
JavaScript
Raw Normal View History

2021-03-12 15:26:02 +00:00
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;