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/selectTicket.js

16 lines
513 B
JavaScript

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;