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

21 lines
542 B
JavaScript
Raw Normal View History

2021-03-12 15:26:02 +00:00
const con = require('./connect')
2021-03-15 08:42:05 +00:00
2021-03-16 07:04:58 +00:00
module.exports = function (collectionFk, callback){
2021-03-15 09:37:07 +00:00
let consSql = `SELECT t.id AS Ticket, c.name AS Client, am.name AS Agency, tc.level AS Level
2021-03-15 08:42:05 +00:00
FROM ticketCollection tc
2021-03-15 09:10:37 +00:00
JOIN ticket t ON t.id = tc.ticketFk JOIN client c ON t.clientFk = c.id
2021-03-15 08:42:05 +00:00
JOIN agencyMode am ON am.id = t.agencyModeFk
WHERE tc.collectionFk = ${collectionFk}`;
2021-03-16 07:04:58 +00:00
2021-03-15 08:42:05 +00:00
con.con.query(consSql, function (err, result, fields) {
2021-03-12 15:26:02 +00:00
console.log(result);
2021-03-15 08:42:05 +00:00
callback(null,result);
2021-03-12 15:26:02 +00:00
});
}
2021-03-15 09:10:37 +00:00
2021-03-16 07:04:58 +00:00
console.log("PROBA");
2021-03-12 15:26:02 +00:00