const con = require('./connect'); function select(ticket, callback) { let consSql = `SELECT st.ticketFk AS Ticket, st.shelvingFk AS Shelving, st.level AS Level, t.clientFk AS Client, am.name AS Agency FROM smartTag st JOIN ticket t ON st.ticketFk = t.id JOIN client c ON t.clientFk = c.id JOIN agencyMode am ON am.id = t.agencyModeFk WHERE st.ticketFk = ${ticket}`; con.con.query(consSql, function(err, result, fields) { callback(null, result); }); } exports.select = select;