add selectTicket

This commit is contained in:
alexmorenograu 2021-03-25 09:33:53 +01:00
parent cf8d51ddf9
commit 214aee2285
3 changed files with 16 additions and 1 deletions

15
db/selectTicket.js Normal file
View File

@ -0,0 +1,15 @@
const con = require('./connect');
function select(ticket, callback) {
let consSql = `SELECT st.ticketFk AS Ticket, st.shelvingFk AS Shelving, st.level AS Level, c.name 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;

View File

@ -1,6 +1,6 @@
const express = require('express');
const router = express.Router(); // eslint-disable-line
const select = require('../db/selectDB');
const select = require('../db/selectCollection');
const filter = require('../utilities/filter');
router.get('/:collectionShelving&:collectionFk', async(req, res) => {