select
This commit is contained in:
parent
587cb72cab
commit
6e9f7f7e38
|
@ -9,13 +9,14 @@ var collectionFk = '254';
|
|||
|
||||
|
||||
function ticketCollection(collectionFk){//parametro collectionFk
|
||||
let consultaSql = select.select(collectionFk)
|
||||
if(filter.filterShelving(shelving)){
|
||||
// insert.insertTicket(consultaSql, shelving)
|
||||
}
|
||||
else{
|
||||
console.log("¡MATRICULA INCORRECTA!")
|
||||
}
|
||||
select.select(collectionFk, function(err,data){
|
||||
if(filter.filterShelving(shelving)){
|
||||
insert.insertTicket(data, shelving)
|
||||
}
|
||||
else{
|
||||
console.log("¡MATRICULA INCORRECTA!")
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ticketCollection(collectionFk, shelving);
|
|
@ -4,22 +4,17 @@ const con = require('./connect')
|
|||
//cliente
|
||||
//agencia
|
||||
var x;
|
||||
function select(collectionFk){
|
||||
con.con.connect(function(err) {
|
||||
let consSql = `SELECT t.id, t.clientFk, am.name
|
||||
FROM ticketCollection tc
|
||||
JOIN ticket t ON t.id = tc.ticketFk
|
||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||
WHERE tc.collectionFk = ${collectionFk}`;
|
||||
if (err) throw err;
|
||||
con.con.query(consSql, function (err, result, fields) {
|
||||
if (err) throw err;
|
||||
console.log(result);
|
||||
x = result;
|
||||
});
|
||||
});
|
||||
console.log("RESULT FUERA "+x);
|
||||
}
|
||||
function select(collectionFk, callback){
|
||||
|
||||
let consSql = `SELECT t.id, t.clientFk, am.name
|
||||
FROM ticketCollection tc
|
||||
JOIN ticket t ON t.id = tc.ticketFk
|
||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||
WHERE tc.collectionFk = ${collectionFk}`;
|
||||
con.con.query(consSql, function (err, result, fields) {
|
||||
console.log(result);
|
||||
callback(null,result);
|
||||
});
|
||||
}
|
||||
exports.select = select;
|
||||
|
||||
|
|
Reference in New Issue