Ultimo aggiornamento Nuova versione del Sito !

This commit is contained in:
Paolo Arena
2020-05-14 17:23:17 +02:00
parent 0565339bab
commit 59910ddec7
9 changed files with 457 additions and 105 deletions

View File

@@ -477,31 +477,35 @@ router.post('/dbop', authenticate, async (req, res) => {
} else if (mydata.dbop === 'eliminaListeIngressoNascoste') {
ris = await ListaIngresso.eliminaListeIngressoNascoste(idapp);
ris = { mystr };
} else if (mydata.dbop === 'RendiVisibileIrecordNascosti') {
ris = await ListaIngresso.RendiVisibileIrecordNascosti(idapp);
ris = { mystr };
} else if (mydata.dbop === 'convNaviTessinListaIngressoRec') {
let num = 0;
const arrnavitess = await Nave.find({idapp, num_tess: { $gte: 3 } });
const arrnavitess = await Nave.find({ idapp, num_tess: { $gte: 3 } });
for (const recnave of arrnavitess) {
if (recnave.num_tess === 3 || recnave.num_tess === 5 || recnave.num_tess === 7) {
const ind_order = recnave.ind_order;
// Prima controlla se ho già 2 record dello stesso ind_order, allora non lo faccio:
const arringr = await ListaIngresso.find({idapp, ind_order});
const arringr = await ListaIngresso.find({ idapp, ind_order });
let dafare = true;
if (arringr.length > 0) {
const arringrtest = await ListaIngresso.find({idapp, ind_order}).distinct('num_tess');
if (arringr.length !== arringrtest.length){
const arringrtest = await ListaIngresso.find({ idapp, ind_order }).distinct('num_tess');
if (arringr.length !== arringrtest.length) {
dafare = false; // Ci sono 2 o piu record! pertanto probabilmente l'ho già fatto!
}
}
if (dafare) {
const user = await User.findByOldOrder(idapp, ind_order);
// const user = await User.findByOldOrder(idapp, ind_order);
const user = await User.findByIndOrder(idapp, ind_order);
if (!!user) {
let note = recnave.num_tess;
//let note = recnave.num_tess;
// Crea record ListaIngresso
const newrecingr = await ListaIngresso.addUserInListaIngresso(idapp, user.username, user.username, user.lang, false, true, recnave.created, note, true);
const newrecingr = await ListaIngresso.addUserInListaIngresso(idapp, user.username, user.username, user.lang, false, true, recnave.created, '', true);
const fieldsvalue = {
ind_order: newrecingr.ind_order,
@@ -517,6 +521,14 @@ router.post('/dbop', authenticate, async (req, res) => {
}
}
const arrnavitess2 = await Nave.find({ idapp, num_tess: 2 });
for (const recnave of arrnavitess2) {
}
ris = { num };
} else if (mydata.dbop === 'initListaIngresso') {
@@ -664,7 +676,7 @@ router.post('/dbop', authenticate, async (req, res) => {
} else if (mydata.dbop === 'visuPlacca') {
mystr = '✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨\n' +
'ECCO LE NUOVE NAVI DEFINITIVE CHE APRONO DOMANI LA GIFT CHAT !!! DALLA ' + mydata.riga + '.' + mydata.col + ' ALLA ' + mydata.riga + '.' + (parseInt(mydata.col) + 7) +'\n' +
'ECCO LE NUOVE NAVI DEFINITIVE CHE APRONO DOMANI LA GIFT CHAT !!! DALLA ' + mydata.riga + '.' + mydata.col + ' ALLA ' + mydata.riga + '.' + (parseInt(mydata.col) + 7) + '\n' +
'AUGURI ALLA NUOVA SOGNATRICE !!!\n' +
'✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨';