Aggiornamenti 2

This commit is contained in:
Paolo Arena
2020-05-04 19:34:41 +02:00
parent 2549d43447
commit 7d0538f7ae
29 changed files with 698 additions and 221 deletions

View File

@@ -141,12 +141,13 @@ router.post('/', async (req, res) => {
user.ind_order = lastindorder + 1;
const numero = user.name.slice(-1);
if ((numero === '2') || (numero === '3') || (numero === '4')) {
if ((numero === '2') || (numero === '3') || (numero === '4') || (numero === '5') || (numero === '6')) {
recorig = await User.findByCellAndNameSurname(user.idapp, user.profile.cell, user.name.slice(0, -1), user.surname);
if (!!recorig) {
user.profile.teleg_id = recorig.profile.teleg_id;
user.profile.saw_zoom_presentation = recorig.profile.saw_zoom_presentation;
user.profile.saw_and_accepted = recorig.profile.saw_and_accepted;
user.profile.my_dream = recorig.profile.my_dream;
user.profile.email_paypal = recorig.profile.email_paypal;
user.profile.paymenttypes = recorig.profile.paymenttypes;
let msgseconda = '!!! REGISTRATA ';
@@ -465,7 +466,7 @@ router.post('/dbop', authenticate, async (req, res) => {
} else if (mydata.dbop === 'visuListaNave') {
mystr = await Nave.showListaOrd(idapp);
ris = { mystr };
} else if (mydata.dbop === 'visuUtentiNonInNavi') {
} else if (mydata.dbop === 'visuStat') {
ris = await User.visuUtentiNonInNavi(idapp);
} else if (mydata.dbop === 'pulisciNonPresenzeInNave') {
mystr = await Nave.pulisciNonPresenzeInNave(idapp);
@@ -616,12 +617,34 @@ router.post('/dbop', authenticate, async (req, res) => {
ris = { num };
} else if (mydata.dbop === 'visuPlacca') {
const rec = {};
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' +
'AUGURI ALLA NUOVA SOGNATRICE !!!\n' +
'✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨';
const visu_nave_Bot = await Settings.getValDbSettings(idapp, 'VISU_NAVE_BOT');
for (let ind = 0; ind < 8; ind++) {
mystr += await Nave.getNavePos(idapp, parseInt(mydata.riga), parseInt(mydata.col) + ind, false);
mystr += tools.ACAPO;
if (visu_nave_Bot && ind === 3) {
await telegrambot.sendMsgTelegramToTheAdmin(idapp, mystr, true);
mystr = '';
}
}
if (visu_nave_Bot)
await telegrambot.sendMsgTelegramToTheAdmin(idapp, mystr, true);
ris = { mystr };
/*const rec = {};
const placca = await Nave.getPlaccaPerDonatore(idapp, parseInt(mydata.riga), parseInt(mydata.col), false, rec);
telegrambot.sendMsgTelegramToTheAdmin(idapp, placca);
ris = { placca };
ris = { placca };*/
} else if (mydata.dbop === 'visuNave') {
mystr = await Nave.getNavePos(idapp, parseInt(mydata.riga), parseInt(mydata.col));
@@ -652,7 +675,7 @@ router.post('/dbop', authenticate, async (req, res) => {
res.send(ris);
} catch (e) {
console.log(e);
console.log(e.message);
}
}
);