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.
2021-03-12 15:26:02 +00:00
|
|
|
const con = require('./connect')
|
|
|
|
|
2021-03-15 08:42:05 +00:00
|
|
|
|
2021-03-16 07:58:58 +00:00
|
|
|
function select(collectionFk, callback){
|
|
|
|
let consSql = `SELECT t.id AS Ticket, c.name AS Client, am.name AS Agency, tc.level AS Level, tc.wagon AS Wagon
|
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:58:58 +00:00
|
|
|
exports.select =select;
|
2021-03-16 07:04:58 +00:00
|
|
|
|
|
|
|
|
2021-03-12 15:26:02 +00:00
|
|
|
|