Ultimo aggiornamento Nuova versione del Sito !
This commit is contained in:
@@ -3,20 +3,14 @@ AGGIORNARE:
|
|||||||
|
|
||||||
// ++Todo: DA FARE:
|
// ++Todo: DA FARE:
|
||||||
|
|
||||||
|
- Se sei imbarcata i tuoi due invitati usati per quella posizione sono bloccati. Se ne hai in più li puoi regalare
|
||||||
|
- Mettere il tragitto anche sul BOT.
|
||||||
|
|
||||||
|
|
||||||
TESTARE -> inviare il msg anche al Sognatore della Gift Chat
|
TESTARE -> inviare il msg anche al Sognatore della Gift Chat
|
||||||
X - Aggiornare il titolo della Gift Chat (da 5/5 a 12/5)
|
|
||||||
X - Aggiornare il testo sulla Placca (Data Inizio e Data Fine Doni)
|
|
||||||
|
|
||||||
|
|
||||||
// ++Todo: SISTEMARE:
|
// ++Todo: SISTEMARE:
|
||||||
X - Devo comparire come mio invitato se aggiungo un nuovo Viaggio.
|
|
||||||
X - Fare la lista delle Navi (in alto alla Lavagna) con il loro tragitto.
|
|
||||||
X- Nel campo note, metterci il Sogno
|
|
||||||
X - Se nave Temporanea, mettere Info.
|
|
||||||
X- Mettere flag se si vuole spostare l'Utente oppure Aggiungerlo...
|
|
||||||
|
|
||||||
- Mettere Sfondo immagine su ogni nave
|
|
||||||
- Mettere il tragitto anche sul BOT.
|
|
||||||
|
|
||||||
|
|
||||||
x- AGGIONARE AMBIENTE DI TEST
|
x- AGGIONARE AMBIENTE DI TEST
|
||||||
@@ -28,7 +22,7 @@ x - Sistemare le navi con num_tess === 4 : indorder=0 e 46 :
|
|||||||
|
|
||||||
-------------
|
-------------
|
||||||
- AGGIONARE AMBIENTE DI PRODUZIONE
|
- AGGIONARE AMBIENTE DI PRODUZIONE
|
||||||
- ESEGUIRE LA CONVERSIONE 1 E 2 !
|
- ESEGUIRE LA CONVERSIONE 1 E 2 e !
|
||||||
|
|
||||||
- Sistemare le navi con num_tess === 4 : indorder=0 e 46 :
|
- Sistemare le navi con num_tess === 4 : indorder=0 e 46 :
|
||||||
Prendere quelli del num_tess === 3 e SOSTITUISCI ind_order del num_Tess = 4 con ind_order di num_tess = 3
|
Prendere quelli del num_tess === 3 e SOSTITUISCI ind_order del num_Tess = 4 con ind_order di num_tess = 3
|
||||||
@@ -52,3 +46,38 @@ SOSTITUISCI:
|
|||||||
TRADURRE:
|
TRADURRE:
|
||||||
|
|
||||||
- Mettere le bandierine nella lista Zoom (su AYNI BOT).
|
- Mettere le bandierine nella lista Zoom (su AYNI BOT).
|
||||||
|
|
||||||
|
|
||||||
|
1- mi appaiono prima le navi del secondo account
|
||||||
|
2- forse metterei ogni nave seguita dal relativo viaggio di "ritorno" (a me piace chiamarlo così!)
|
||||||
|
X 3- sotto le navi, alla voce donatore, c'è ancora scritto "Effettuerai il tuo dono ESATTAMENTE il giorno indicato"
|
||||||
|
X 4- nei miei invitati non compaiono le mie ritessiture, fatte con il magico bottone, da chi sono invitata?
|
||||||
|
|
||||||
|
|
||||||
|
- Controllare Tragitto (Elisabetta)
|
||||||
|
- Monica Sozzi -> Davide Moirano (0) è giusto.
|
||||||
|
- Andrea Decouter (2)
|
||||||
|
- Enrica Pescio (OK)
|
||||||
|
- 852 (Gerico2) Elio2 Garelli -> (Gerico)
|
||||||
|
|
||||||
|
Andrea 346
|
||||||
|
|
||||||
|
ind_order: 231 Gerico Elio Garelli
|
||||||
|
ind_order: 852 Gerico2 Elio2 Garelli
|
||||||
|
|
||||||
|
|
||||||
|
Morgana Roveta (Maelabo)
|
||||||
|
--- Gerico Elio Garelli
|
||||||
|
|
||||||
|
|
||||||
|
ANDREA
|
||||||
|
|-----GERICO2 852
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.update({}, {$unset: {$ind_order: 1}, {multi: true});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
28
docs/query_mongodb.js
Normal file
28
docs/query_mongodb.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
db.getCollection('users').aggregate([
|
||||||
|
{ $match: { idapp: '7', username:'Emycapp' } },
|
||||||
|
{
|
||||||
|
$lookup: {
|
||||||
|
from: "naves",
|
||||||
|
as: "ingr",
|
||||||
|
let: { ind_order: '$ind_order' },
|
||||||
|
pipeline: [
|
||||||
|
{
|
||||||
|
$match: {
|
||||||
|
$expr: {
|
||||||
|
$and: [
|
||||||
|
{ $eq: ['$ind_order', '$$ind_order'] },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$replaceRoot: { newRoot: { $mergeObjects: [{ $arrayElemAt: ["$ingr", 0] }, "$$ROOT"] } }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$match: { made_gift: { $exists: true } }
|
||||||
|
}
|
||||||
|
|
||||||
|
])
|
||||||
@@ -43,6 +43,9 @@ const ListaIngressoSchema = new mongoose.Schema({
|
|||||||
date_added: {
|
date_added: {
|
||||||
type: Date,
|
type: Date,
|
||||||
},
|
},
|
||||||
|
date_deleted: {
|
||||||
|
type: Date,
|
||||||
|
},
|
||||||
added: { // Added into Programmation (Nave)
|
added: { // Added into Programmation (Nave)
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
@@ -311,6 +314,50 @@ function getQueryProj(myfilter, myobjField, myfilter2, mygroup) {
|
|||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getQueryIndOrder(myfilter, myobjField, myfilter2, mygroup) {
|
||||||
|
const query = [
|
||||||
|
{ $match: myfilter },
|
||||||
|
{
|
||||||
|
$lookup: {
|
||||||
|
from: "users",
|
||||||
|
as: "user",
|
||||||
|
let: { ind_order: '$ind_order' },
|
||||||
|
pipeline: [
|
||||||
|
{
|
||||||
|
$match: {
|
||||||
|
$expr: {
|
||||||
|
$and: [
|
||||||
|
{ $eq: ['$ind_order', '$$ind_order'] },
|
||||||
|
{ $eq: ['$idapp', myfilter.idapp] },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$replaceRoot: { newRoot: { $mergeObjects: [{ $arrayElemAt: ["$user", 0] }, "$$ROOT"] } }
|
||||||
|
},
|
||||||
|
{ $match: myfilter2 },
|
||||||
|
];
|
||||||
|
|
||||||
|
if (!!mygroup) {
|
||||||
|
query.push(
|
||||||
|
{ $group: mygroup }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!!myobjField) {
|
||||||
|
query.push(
|
||||||
|
{ $project: myobjField }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ListaIngressoSchema.statics.getPosizioneInLista = async function (idapp, arrrec, ind_order, num_tess) {
|
ListaIngressoSchema.statics.getPosizioneInLista = async function (idapp, arrrec, ind_order, num_tess) {
|
||||||
|
|
||||||
|
|
||||||
@@ -338,9 +385,11 @@ ListaIngressoSchema.statics.showListaOrd = async function (idapp, solonuovi) {
|
|||||||
let mystr = '';
|
let mystr = '';
|
||||||
let conta = 1;
|
let conta = 1;
|
||||||
for (const rec of arrrec) {
|
for (const rec of arrrec) {
|
||||||
mystr += conta + ' - ' + ' [' + rec.numinvitatiattivi + '] - [' + rec.numinvitati + '] (' + rec.ind_order + ') ' + rec.username + ' ' + rec.name + ' ' + rec.surname;
|
mystr += conta + '- ' + ' [' + rec.numinvitatiattivi + '-' + rec.numinvitati + '] (' + rec.index + ') ';
|
||||||
|
mystr += ' [' + tools.getstrDateShort(rec.date_added, 'it') + '] ';
|
||||||
|
mystr += rec.username + ' ' + rec.name + ' ' + rec.surname;
|
||||||
mystr += ' inv = ' + rec.invitante_username;
|
mystr += ' inv = ' + rec.invitante_username;
|
||||||
mystr += ' num_tess = ' + rec.num_tess;
|
mystr += ' tess = ' + rec.num_tess;
|
||||||
if (rec.added)
|
if (rec.added)
|
||||||
mystr += ' (ADDED ++)';
|
mystr += ' (ADDED ++)';
|
||||||
|
|
||||||
@@ -388,6 +437,7 @@ ListaIngressoSchema.statics.getProssimiInLista = async function (idapp, solonuov
|
|||||||
|
|
||||||
let myobjField = {
|
let myobjField = {
|
||||||
idapp: 1,
|
idapp: 1,
|
||||||
|
index: 1,
|
||||||
ind_order: 1,
|
ind_order: 1,
|
||||||
name: 1,
|
name: 1,
|
||||||
surname: 1,
|
surname: 1,
|
||||||
@@ -396,6 +446,7 @@ ListaIngressoSchema.statics.getProssimiInLista = async function (idapp, solonuov
|
|||||||
email: 1,
|
email: 1,
|
||||||
lang: 1,
|
lang: 1,
|
||||||
num_tess: 1,
|
num_tess: 1,
|
||||||
|
date_added: 1,
|
||||||
added: 1,
|
added: 1,
|
||||||
deleted: 1,
|
deleted: 1,
|
||||||
sospeso: 1,
|
sospeso: 1,
|
||||||
@@ -491,6 +542,14 @@ ListaIngressoSchema.statics.eliminaListeIngressoNascoste = async function (idapp
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ListaIngressoSchema.statics.RendiVisibileIrecordNascosti = async function (idapp) {
|
||||||
|
const ListaIngresso = this;
|
||||||
|
|
||||||
|
const num = await ListaIngresso.updateMany({ idapp, deleted: true }, { $set: { deleted: false } });
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
ListaIngressoSchema.statics.creaTessituraeConv = async function (idapp) {
|
ListaIngressoSchema.statics.creaTessituraeConv = async function (idapp) {
|
||||||
const ListaIngresso = this;
|
const ListaIngresso = this;
|
||||||
|
|
||||||
@@ -513,8 +572,6 @@ ListaIngressoSchema.statics.creaTessituraeConv = async function (idapp) {
|
|||||||
idapp,
|
idapp,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Ricalcola il Campo Index
|
|
||||||
await User.ricalcolaIndex(idapp);
|
|
||||||
|
|
||||||
// Ricrea i record ListaIngresso (num_tess = 1), per ogni User
|
// Ricrea i record ListaIngresso (num_tess = 1), per ogni User
|
||||||
for (const user of arrusers) {
|
for (const user of arrusers) {
|
||||||
@@ -634,7 +691,7 @@ ListaIngressoSchema.statics.creaTessituraeConv = async function (idapp) {
|
|||||||
await ListaIngresso.findByIdAndUpdate(findlistaingresso._id, {
|
await ListaIngresso.findByIdAndUpdate(findlistaingresso._id, {
|
||||||
$set: {
|
$set: {
|
||||||
username,
|
username,
|
||||||
invitante_username,
|
// invitante_username,
|
||||||
note: findlistaingresso.username,
|
note: findlistaingresso.username,
|
||||||
}
|
}
|
||||||
}, { new: false });
|
}, { new: false });
|
||||||
@@ -652,7 +709,7 @@ ListaIngressoSchema.statics.creaTessituraeConv = async function (idapp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// poi imposta come cancellato questo record
|
// poi imposta come cancellato questo record
|
||||||
await User.findByIdAndUpdate(myuser._id, { $set: { deleted: true } });
|
await User.findByIdAndUpdate(myuser._id, { $set: { deleted: true, date_deleted: new Date() } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -660,6 +717,13 @@ ListaIngressoSchema.statics.creaTessituraeConv = async function (idapp) {
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RIMUOVI IL CAMPO IND_ORDER SULLA USER!
|
||||||
|
await User.update({}, {$unset: {ind_order: 1}}, {multi: true});
|
||||||
|
|
||||||
|
// Ricalcola il Campo Index
|
||||||
|
await User.ricalcolaIndex(idapp);
|
||||||
|
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -684,6 +748,13 @@ ListaIngressoSchema.statics.getListaTessByUsername = function (idapp, username)
|
|||||||
ListaIngressoSchema.statics.getarray = async function (idapp, filtri, myobjField) {
|
ListaIngressoSchema.statics.getarray = async function (idapp, filtri, myobjField) {
|
||||||
const ListaIngresso = this;
|
const ListaIngresso = this;
|
||||||
|
|
||||||
|
const { User } = require('./user');
|
||||||
|
|
||||||
|
if (!await User.NuovoSistema(idapp)) {
|
||||||
|
return await ListaIngresso.getarrayIndOrder(idapp, filtri, myobjField);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
let myfilter2 = {
|
let myfilter2 = {
|
||||||
surname: { $exists: true },
|
surname: { $exists: true },
|
||||||
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
@@ -699,6 +770,24 @@ ListaIngressoSchema.statics.getarray = async function (idapp, filtri, myobjField
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ListaIngressoSchema.statics.getarrayIndOrder = async function (idapp, filtri, myobjField) {
|
||||||
|
const ListaIngresso = this;
|
||||||
|
|
||||||
|
let myfilter2 = {
|
||||||
|
surname: { $exists: true },
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
|
};
|
||||||
|
|
||||||
|
let myquery = getQueryIndOrder(
|
||||||
|
filtri,
|
||||||
|
myobjField,
|
||||||
|
myfilter2
|
||||||
|
);
|
||||||
|
|
||||||
|
return await ListaIngresso.aggregate(myquery);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
ListaIngressoSchema.statics.getInvitati = async function (idapp, username, includemyself, myobjField) {
|
ListaIngressoSchema.statics.getInvitati = async function (idapp, username, includemyself, myobjField) {
|
||||||
const ListaIngresso = this;
|
const ListaIngresso = this;
|
||||||
@@ -758,10 +847,10 @@ ListaIngressoSchema.statics.getnumInvitati = async function (idapp, username) {
|
|||||||
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
});
|
});
|
||||||
|
|
||||||
/*for (const inv of arrinv) {
|
for (const inv of arrinv) {
|
||||||
if (!arrlistainv.find((rec) => rec.username === inv.username))
|
if (!arrlistainv.find((rec) => rec.username === inv.username))
|
||||||
arrlistainv.push(inv);
|
arrlistainv.push(inv);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if (!!arrlistainv)
|
if (!!arrlistainv)
|
||||||
return arrlistainv.length;
|
return arrlistainv.length;
|
||||||
@@ -802,11 +891,11 @@ ListaIngressoSchema.statics.getnumInvitatiAttivi = async function (idapp, userna
|
|||||||
$and: User.getQueryQualified()
|
$and: User.getQueryQualified()
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
|
||||||
for (const inv of arrinv) {
|
for (const inv of arrinv) {
|
||||||
if (!arrlistainv.find((rec) => rec.username === inv.username))
|
if (!arrlistainv.find((rec) => rec.username === inv.username))
|
||||||
arrlistainv.push(inv);
|
arrlistainv.push(inv);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if (!!arrlistainv)
|
if (!!arrlistainv)
|
||||||
return arrlistainv.length;
|
return arrlistainv.length;
|
||||||
|
|||||||
@@ -485,6 +485,71 @@ function getQueryProj(myfilter) {
|
|||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getQueryInvitante(myfilter) {
|
||||||
|
|
||||||
|
myobjField = {
|
||||||
|
ind_order: 1,
|
||||||
|
name: 1,
|
||||||
|
surname: 1,
|
||||||
|
username: 1,
|
||||||
|
invitante_username: 1,
|
||||||
|
made_gift: 1,
|
||||||
|
sent_msg_howto_make_gift: 1,
|
||||||
|
date_made_gift: 1,
|
||||||
|
note: 1,
|
||||||
|
received_gift: 1,
|
||||||
|
date_received_gift: 1,
|
||||||
|
num_tess: 1,
|
||||||
|
parent_id: 1,
|
||||||
|
riga: 1,
|
||||||
|
col: 1,
|
||||||
|
created: 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
const query = [
|
||||||
|
{ $match: myfilter },
|
||||||
|
{
|
||||||
|
$lookup: {
|
||||||
|
from: "listaingressos",
|
||||||
|
localField: "ind_order",
|
||||||
|
foreignField: "ind_order", // field in the user collection
|
||||||
|
as: "mylista"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$replaceRoot: { newRoot: { $mergeObjects: [{ $arrayElemAt: ["$mylista", 0] }, "$$ROOT"] } }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$lookup: {
|
||||||
|
from: "users",
|
||||||
|
as: "user",
|
||||||
|
let: { username: '$username' },
|
||||||
|
pipeline: [
|
||||||
|
{
|
||||||
|
$match: {
|
||||||
|
$expr: {
|
||||||
|
$and: [
|
||||||
|
{ $eq: ['$username', '$$username'] },
|
||||||
|
{ $eq: ['$idapp', myfilter.idapp] },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$replaceRoot: { newRoot: { $mergeObjects: [{ $arrayElemAt: ["$user", 0] }, "$$ROOT"] } }
|
||||||
|
// $replaceRoot: { newRoot: { $mergeObjects: [{ $arrayElemAt: ["$user", 0] },] } }
|
||||||
|
},
|
||||||
|
{ $match: { $or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }] } },
|
||||||
|
{ $project: myobjField }
|
||||||
|
];
|
||||||
|
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NaveSchema.statics.setRiga = function (idapp, riga) {
|
NaveSchema.statics.setRiga = function (idapp, riga) {
|
||||||
return Settings.setKeyNum(idapp, 'riga', riga);
|
return Settings.setKeyNum(idapp, 'riga', riga);
|
||||||
@@ -848,11 +913,22 @@ NaveSchema.statics.getArrPosizioniByUsername = async function (idapp, username)
|
|||||||
|
|
||||||
let arrposizioni = [];
|
let arrposizioni = [];
|
||||||
|
|
||||||
|
for (const ind_order of arrrec_indorder) {
|
||||||
|
const myquery = getQueryInvitante({ idapp, ind_order });
|
||||||
|
|
||||||
|
const arr = await Nave.aggregate(myquery).sort({ riga: 1, col: 1 });
|
||||||
|
if (!!arr)
|
||||||
|
arrposizioni = [...arrposizioni, ...arr];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
for (const ind_order of arrrec_indorder) {
|
for (const ind_order of arrrec_indorder) {
|
||||||
const arr = await Nave.find({ 'idapp': idapp, ind_order }).sort({ riga: 1, col: 1 });
|
const arr = await Nave.find({ 'idapp': idapp, ind_order }).sort({ riga: 1, col: 1 });
|
||||||
if (!!arr)
|
if (!!arr)
|
||||||
arrposizioni = [...arrposizioni, ...arr];
|
arrposizioni = [...arrposizioni, ...arr];
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return arrposizioni;
|
return arrposizioni;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ const UserSchema = new mongoose.Schema({
|
|||||||
date_reg: {
|
date_reg: {
|
||||||
type: Date,
|
type: Date,
|
||||||
},
|
},
|
||||||
|
date_deleted: {
|
||||||
|
type: Date,
|
||||||
|
},
|
||||||
date_tokenforgot: {
|
date_tokenforgot: {
|
||||||
type: Date
|
type: Date
|
||||||
},
|
},
|
||||||
@@ -143,7 +146,8 @@ const UserSchema = new mongoose.Schema({
|
|||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
deleted: {
|
deleted: {
|
||||||
type: Boolean
|
type: Boolean,
|
||||||
|
default: false
|
||||||
},
|
},
|
||||||
sospeso: {
|
sospeso: {
|
||||||
type: Boolean
|
type: Boolean
|
||||||
@@ -445,12 +449,12 @@ UserSchema.statics.getUserShortDataByUsername = async function (idapp, username)
|
|||||||
return myrec
|
return myrec
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.getDownlineByUsername = async function (idapp, username, includemyself) {
|
UserSchema.statics.getDownlineByUsername = async function (idapp, username, includemyself, onlynumber) {
|
||||||
|
|
||||||
if (username === undefined)
|
if (username === undefined)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
const arrrec = await ListaIngresso.getInvitati(idapp, username, includemyself,
|
let arrrec = await ListaIngresso.getInvitati(idapp, username, includemyself,
|
||||||
{
|
{
|
||||||
index: 1,
|
index: 1,
|
||||||
lang: 1,
|
lang: 1,
|
||||||
@@ -489,10 +493,28 @@ UserSchema.statics.getDownlineByUsername = async function (idapp, username, incl
|
|||||||
|
|
||||||
for (const inv of arrinv) {
|
for (const inv of arrinv) {
|
||||||
if (!arrrec.find((rec) => rec.username === inv.username))
|
if (!arrrec.find((rec) => rec.username === inv.username))
|
||||||
arrrec.push(inv);
|
arrrec.push(inv._doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const arrusername = [];
|
||||||
|
|
||||||
|
for (const inv of arrrec) {
|
||||||
|
|
||||||
|
const rectrovato = arrusername.find((rec) => inv.username === rec.username);
|
||||||
|
if (!!rectrovato) {
|
||||||
|
rectrovato.quanti++;
|
||||||
|
} else {
|
||||||
|
const myrec = { ...inv };
|
||||||
|
myrec.quanti = 1;
|
||||||
|
arrusername.push(myrec)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
arrrec = arrusername;
|
||||||
|
|
||||||
|
|
||||||
|
if (!onlynumber) {
|
||||||
if (!!arrrec) {
|
if (!!arrrec) {
|
||||||
for (const rec of arrrec) {
|
for (const rec of arrrec) {
|
||||||
rec.qualified = await User.isUserQualified7(idapp, rec.username);
|
rec.qualified = await User.isUserQualified7(idapp, rec.username);
|
||||||
@@ -501,6 +523,7 @@ UserSchema.statics.getDownlineByUsername = async function (idapp, username, incl
|
|||||||
rec.numinvitatiattivi = await ListaIngresso.getnumInvitatiAttivi(idapp, rec.username);
|
rec.numinvitatiattivi = await ListaIngresso.getnumInvitatiAttivi(idapp, rec.username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return arrrec;
|
return arrrec;
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -928,7 +951,7 @@ UserSchema.statics.getSmallRecByIndOrder = async function (idapp, ind_order) {
|
|||||||
{
|
{
|
||||||
idapp,
|
idapp,
|
||||||
ind_order,
|
ind_order,
|
||||||
deleted: false,
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
idapp: 1,
|
idapp: 1,
|
||||||
@@ -953,15 +976,44 @@ UserSchema.statics.getSmallRecByIndOrder = async function (idapp, ind_order) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.getRecByIndOrder = async function (idapp, ind_order) {
|
UserSchema.statics.NuovoSistema = function (idapp) {
|
||||||
|
const User = this;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
return User.findOne({ idapp, old_order: { $exists: true } })
|
||||||
|
.then((ris) => {
|
||||||
|
return !!ris;
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error('NuovoSistema', e.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
UserSchema.statics.getRecByIndOrder = async function (idapp, ind_order) {
|
||||||
|
const User = this;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
let filters = {
|
||||||
|
idapp: 1,
|
||||||
|
index: 1,
|
||||||
|
ind_order: 1,
|
||||||
|
old_order: 1,
|
||||||
|
username: 1,
|
||||||
|
name: 1,
|
||||||
|
lang: 1,
|
||||||
|
surname: 1,
|
||||||
|
'profile.teleg_id': 1,
|
||||||
|
};
|
||||||
|
|
||||||
const rec = await ListaIngresso.getarray(idapp,
|
const rec = await ListaIngresso.getarray(idapp,
|
||||||
{
|
{
|
||||||
idapp,
|
idapp,
|
||||||
ind_order,
|
ind_order,
|
||||||
deleted: false,
|
},
|
||||||
});
|
filters);
|
||||||
|
|
||||||
if (!!rec)
|
if (!!rec)
|
||||||
return rec[0];
|
return rec[0];
|
||||||
@@ -1139,7 +1191,6 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
|||||||
// DATA: username, name, surname, email, intcode_cell, cell
|
// DATA: username, name, surname, email, intcode_cell, cell
|
||||||
const dashboard = {
|
const dashboard = {
|
||||||
aportador: {},
|
aportador: {},
|
||||||
downline: [],
|
|
||||||
arrposizioni: [],
|
arrposizioni: [],
|
||||||
arrimbarchi: [],
|
arrimbarchi: [],
|
||||||
arrusers: {},
|
arrusers: {},
|
||||||
@@ -1152,26 +1203,10 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
|||||||
// dashboard.aportador = await ExtraList.getUserNotRegisteredByNameSurname(idapp, aportador_solidario_nome_completo);
|
// dashboard.aportador = await ExtraList.getUserNotRegisteredByNameSurname(idapp, aportador_solidario_nome_completo);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
dashboard.downline = [];
|
const arrap = await User.getDownlineByUsername(idapp, username, false, true);
|
||||||
|
|
||||||
// Data of my Downline
|
|
||||||
const arrap = await User.getDownlineByUsername(idapp, username);
|
|
||||||
if (!!arrap)
|
if (!!arrap)
|
||||||
dashboard.numpeople_aportador = arrap.length;
|
dashboard.numpeople_aportador = arrap.length;
|
||||||
|
|
||||||
dashboard.downline = await User.getDownlineByUsername(idapp, username, true);
|
|
||||||
// dashboard.downnotreg = await ExtraList.getDownlineNotRegisteredByNameSurname(idapp, dashboard.myself.name + ' ' + dashboard.myself.surname);
|
|
||||||
|
|
||||||
dashboard.downbyuser = {};
|
|
||||||
|
|
||||||
for (const down of dashboard.downline) {
|
|
||||||
dashboard.downbyuser[down.username] = await User.getDownlineByUsername(idapp, down.username, false);
|
|
||||||
|
|
||||||
for (const down2 of dashboard.downbyuser[down.username]) {
|
|
||||||
dashboard.downbyuser[down2.username] = await User.getDownlineByUsername(idapp, down2.username, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dashboard.arrimbarchi = await ListaIngresso.findAllByUsername(idapp, username);
|
dashboard.arrimbarchi = await ListaIngresso.findAllByUsername(idapp, username);
|
||||||
|
|
||||||
// dashboard.arrprofili = await Nave.getArrProfiliByIndOrder(idapp, dashboard.myself.ind_order);
|
// dashboard.arrprofili = await Nave.getArrProfiliByIndOrder(idapp, dashboard.myself.ind_order);
|
||||||
@@ -1193,8 +1228,8 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
|||||||
dashboard.lastnave = await NavePersistente.getLastNave(idapp);
|
dashboard.lastnave = await NavePersistente.getLastNave(idapp);
|
||||||
|
|
||||||
for (let mypos of dashboard.arrposizioni) {
|
for (let mypos of dashboard.arrposizioni) {
|
||||||
mypos._doc.rec = await Nave.getNaveByRigaCol(idapp, mypos.riga, mypos.col);
|
mypos.rec = await Nave.getNaveByRigaCol(idapp, mypos.riga, mypos.col);
|
||||||
mypos._doc.nave_partenza = await NavePersistente.findByRigaColByDonatore(idapp, mypos.riga, mypos.col, 0);
|
mypos.nave_partenza = await NavePersistente.findByRigaColByDonatore(idapp, mypos.riga, mypos.col, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1205,6 +1240,7 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
|||||||
|
|
||||||
const arrnew = [];
|
const arrnew = [];
|
||||||
|
|
||||||
|
try {
|
||||||
for (let mypos of dashboard.arrposizioni) {
|
for (let mypos of dashboard.arrposizioni) {
|
||||||
// Controlla se è presente la Nave con il num_tess pari
|
// Controlla se è presente la Nave con il num_tess pari
|
||||||
|
|
||||||
@@ -1214,22 +1250,30 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
|||||||
for (let myrec of dashboard.arrposizioni) {
|
for (let myrec of dashboard.arrposizioni) {
|
||||||
if (myrec.num_tess === mypos.num_tess + 1 && (myrec.ind_order === mypos.ind_order)) {
|
if (myrec.num_tess === mypos.num_tess + 1 && (myrec.ind_order === mypos.ind_order)) {
|
||||||
// La Nave di Ritorno (numtess = 2) esiste nella lista !
|
// La Nave di Ritorno (numtess = 2) esiste nella lista !
|
||||||
trovato = true
|
trovato = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
trovato = true;
|
trovato = true;
|
||||||
}
|
}
|
||||||
if (!trovato) {
|
if (!trovato) {
|
||||||
const mymediatore = mypos._doc.rec.mediatore.arrdonatori[7];
|
let myr = null;
|
||||||
|
if (!!mypos._doc)
|
||||||
|
myr = mypos._doc;
|
||||||
|
else
|
||||||
|
myr = mypos;
|
||||||
|
|
||||||
|
if (!!myr && !!myr.rec.mediatore) {
|
||||||
|
const mymediatore = myr.rec.mediatore.arrdonatori[7];
|
||||||
if (!!mymediatore) {
|
if (!!mymediatore) {
|
||||||
const myrec = {
|
const myrec = {
|
||||||
riga: mymediatore.riga,
|
riga: mymediatore.riga,
|
||||||
col: mymediatore.col,
|
col: mymediatore.col,
|
||||||
name: mypos._doc.rec.mediatore.recmediatore.name,
|
name: myr.rec.mediatore.recmediatore.name,
|
||||||
surname: mypos._doc.rec.mediatore.recmediatore.surname,
|
surname: myr.rec.mediatore.recmediatore.surname,
|
||||||
username: mypos._doc.rec.mediatore.recmediatore.username,
|
username: myr.rec.mediatore.recmediatore.username,
|
||||||
num_tess: mypos._doc.rec.mediatore.recmediatore.num_tess + 1,
|
num_tess: myr.rec.mediatore.recmediatore.num_tess + 1,
|
||||||
rec: await Nave.getNaveByRigaCol(idapp, mymediatore.riga, mymediatore.col),
|
rec: await Nave.getNaveByRigaCol(idapp, mymediatore.riga, mymediatore.col),
|
||||||
nave_partenza: {},
|
nave_partenza: {},
|
||||||
};
|
};
|
||||||
@@ -1240,6 +1284,10 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e.message);
|
||||||
|
}
|
||||||
|
|
||||||
dashboard.arrposizioni = [...dashboard.arrposizioni, ...arrnew];
|
dashboard.arrposizioni = [...dashboard.arrposizioni, ...arrnew];
|
||||||
|
|
||||||
@@ -1252,6 +1300,38 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
UserSchema.statics.getDownline = async function (idapp, aportador_solidario, username) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
// DATA: username, name, surname, email, intcode_cell, cell
|
||||||
|
let downline = {};
|
||||||
|
|
||||||
|
downline.downline = [];
|
||||||
|
|
||||||
|
// Data of my Downline
|
||||||
|
const arrap = await User.getDownlineByUsername(idapp, username);
|
||||||
|
if (!!arrap)
|
||||||
|
downline.numpeople_aportador = arrap.length;
|
||||||
|
|
||||||
|
downline.downline = await User.getDownlineByUsername(idapp, username, true);
|
||||||
|
|
||||||
|
downline.downbyuser = {};
|
||||||
|
|
||||||
|
for (const down of downline.downline) {
|
||||||
|
downline.downbyuser[down.username] = await User.getDownlineByUsername(idapp, down.username, false);
|
||||||
|
|
||||||
|
for (const down2 of downline.downbyuser[down.username]) {
|
||||||
|
downline.downbyuser[down2.username] = await User.getDownlineByUsername(idapp, down2.username, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return downline;
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e.message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
UserSchema.statics.fixUsername = async function (idapp, aportador_solidario_ind_order, username) {
|
UserSchema.statics.fixUsername = async function (idapp, aportador_solidario_ind_order, username) {
|
||||||
const User = this;
|
const User = this;
|
||||||
@@ -1780,7 +1860,10 @@ UserSchema.statics.getUsernameByIndex = async function (idapp, index) {
|
|||||||
UserSchema.statics.ricalcolaIndex = async function (idapp) {
|
UserSchema.statics.ricalcolaIndex = async function (idapp) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
const arrusers = await User.find({ idapp }).sort({ ind_order: 1 });
|
const arrusers = await User.find({
|
||||||
|
idapp,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
}).sort({ old_order: 1 });
|
||||||
let index = 0;
|
let index = 0;
|
||||||
try {
|
try {
|
||||||
for (const user of arrusers) {
|
for (const user of arrusers) {
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ router.post('/', authenticate, async (req, res) => {
|
|||||||
let aportador_solidario = req.user.aportador_solidario;
|
let aportador_solidario = req.user.aportador_solidario;
|
||||||
let aportador_solidario_nome_completo = req.user.aportador_solidario_nome_completo;
|
let aportador_solidario_nome_completo = req.user.aportador_solidario_nome_completo;
|
||||||
|
|
||||||
// if (User.isAdmin(req.user.perm) || User.isManager(req.user.perm)) {
|
|
||||||
// const recuser = await User.findByUsername(idapp, username);
|
|
||||||
// if (recuser) {
|
|
||||||
// aportador_solidario_nome_completo = recuser.name + ' ' + recuser.surname;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (username) {
|
if (username) {
|
||||||
aportador_solidario = await User.getAportadorSolidarioByUsername(idapp, username);
|
aportador_solidario = await User.getAportadorSolidarioByUsername(idapp, username);
|
||||||
aportador_solidario_nome_completo = await User.getNameSurnameByUsername(idapp, username);
|
aportador_solidario_nome_completo = await User.getNameSurnameByUsername(idapp, username);
|
||||||
@@ -59,6 +52,37 @@ router.post('/', authenticate, async (req, res) => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.post('/downline', authenticate, async (req, res) => {
|
||||||
|
try {
|
||||||
|
const idapp = req.body.idapp;
|
||||||
|
let username = req.body.username;
|
||||||
|
|
||||||
|
if ((!User.isAdmin(req.user.perm) && !User.isManager(req.user.perm)) && (username) !== req.user.username) {
|
||||||
|
// If without permissions, exit
|
||||||
|
return res.status(404).send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
||||||
|
}
|
||||||
|
let aportador_solidario = req.user.aportador_solidario;
|
||||||
|
let aportador_solidario_nome_completo = req.user.aportador_solidario_nome_completo;
|
||||||
|
|
||||||
|
if (username) {
|
||||||
|
aportador_solidario = await User.getAportadorSolidarioByUsername(idapp, username);
|
||||||
|
aportador_solidario_nome_completo = await User.getNameSurnameByUsername(idapp, username);
|
||||||
|
} else {
|
||||||
|
username = req.user.username;
|
||||||
|
}
|
||||||
|
|
||||||
|
const downline = await User.getDownline(idapp, aportador_solidario, username, aportador_solidario_nome_completo);
|
||||||
|
if (downline)
|
||||||
|
res.send({ downline });
|
||||||
|
else
|
||||||
|
res.status(400).send(e);
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
res.status(400).send(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
router.post('/msgnave', authenticate, async (req, res) => {
|
router.post('/msgnave', authenticate, async (req, res) => {
|
||||||
const idapp = req.body.idapp;
|
const idapp = req.body.idapp;
|
||||||
|
|||||||
@@ -583,6 +583,7 @@ router.patch('/callfunz', authenticate, async (req, res) => {
|
|||||||
olduseringresso = await ListaIngresso.findOne({ idapp, ind_order: mianavedasost.ind_order });
|
olduseringresso = await ListaIngresso.findOne({ idapp, ind_order: mianavedasost.ind_order });
|
||||||
if (!!olduseringresso) {
|
if (!!olduseringresso) {
|
||||||
let fieldsvalue = {
|
let fieldsvalue = {
|
||||||
|
date_deleted: new Date(),
|
||||||
deleted: true
|
deleted: true
|
||||||
};
|
};
|
||||||
const risul = await ListaIngresso.findByIdAndUpdate(olduseringresso.id, { $set: fieldsvalue }, { new: false });
|
const risul = await ListaIngresso.findByIdAndUpdate(olduseringresso.id, { $set: fieldsvalue }, { new: false });
|
||||||
@@ -591,10 +592,16 @@ router.patch('/callfunz', authenticate, async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!!myuservecchio) {
|
if (!!myuservecchio) {
|
||||||
|
// Se ha gia delle altre navi, non cancellarlo!
|
||||||
|
Nave.checkIfMadeGift(idapp, )
|
||||||
|
const noncanc = await Nave.findOne({idapp, ind_order: mianavedasost.ind_order, made_gift: true });
|
||||||
|
|
||||||
|
|
||||||
if (mydata.data.deleteUser && !!mianavedasost && mianavedasost.ind_order > 0) {
|
if (mydata.data.deleteUser && !!mianavedasost && mianavedasost.ind_order > 0) {
|
||||||
// Metti Deleted allo User
|
// Metti Deleted allo User
|
||||||
fieldsvalue = {
|
fieldsvalue = {
|
||||||
deleted: true
|
deleted: true,
|
||||||
|
date_deleted: new Date(),
|
||||||
};
|
};
|
||||||
await User.findByIdAndUpdate(myuservecchio.id, { $set: fieldsvalue });
|
await User.findByIdAndUpdate(myuservecchio.id, { $set: fieldsvalue });
|
||||||
await telegrambot.sendMsgTelegramToTheManagers(idapp, `L\'utente ${myuservecchio.name} ${myuservecchio.surname} (${myuservecchio.username}) è stato cancellato (nascosto) perchè sostituito (da ${req.user.name} ${req.user.surname} )`);
|
await telegrambot.sendMsgTelegramToTheManagers(idapp, `L\'utente ${myuservecchio.name} ${myuservecchio.surname} (${myuservecchio.username}) è stato cancellato (nascosto) perchè sostituito (da ${req.user.name} ${req.user.surname} )`);
|
||||||
@@ -763,7 +770,8 @@ router.delete('/delrec/:table/:id', authenticate, async (req, res) => {
|
|||||||
if (tablename === 'users') {
|
if (tablename === 'users') {
|
||||||
|
|
||||||
let fieldsvalue = {
|
let fieldsvalue = {
|
||||||
deleted: true
|
deleted: true,
|
||||||
|
date_deleted: new Date(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const rec = await mytable.findByIdAndUpdate(id, { $set: fieldsvalue });
|
const rec = await mytable.findByIdAndUpdate(id, { $set: fieldsvalue });
|
||||||
|
|||||||
@@ -477,6 +477,9 @@ router.post('/dbop', authenticate, async (req, res) => {
|
|||||||
} else if (mydata.dbop === 'eliminaListeIngressoNascoste') {
|
} else if (mydata.dbop === 'eliminaListeIngressoNascoste') {
|
||||||
ris = await ListaIngresso.eliminaListeIngressoNascoste(idapp);
|
ris = await ListaIngresso.eliminaListeIngressoNascoste(idapp);
|
||||||
ris = { mystr };
|
ris = { mystr };
|
||||||
|
} else if (mydata.dbop === 'RendiVisibileIrecordNascosti') {
|
||||||
|
ris = await ListaIngresso.RendiVisibileIrecordNascosti(idapp);
|
||||||
|
ris = { mystr };
|
||||||
} else if (mydata.dbop === 'convNaviTessinListaIngressoRec') {
|
} else if (mydata.dbop === 'convNaviTessinListaIngressoRec') {
|
||||||
let num = 0;
|
let num = 0;
|
||||||
|
|
||||||
@@ -496,12 +499,13 @@ router.post('/dbop', authenticate, async (req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dafare) {
|
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) {
|
if (!!user) {
|
||||||
let note = recnave.num_tess;
|
//let note = recnave.num_tess;
|
||||||
// Crea record ListaIngresso
|
// 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 = {
|
const fieldsvalue = {
|
||||||
ind_order: newrecingr.ind_order,
|
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 };
|
ris = { num };
|
||||||
|
|
||||||
} else if (mydata.dbop === 'initListaIngresso') {
|
} else if (mydata.dbop === 'initListaIngresso') {
|
||||||
|
|||||||
@@ -1226,8 +1226,9 @@ class Telegram {
|
|||||||
let mystr = '';
|
let mystr = '';
|
||||||
|
|
||||||
const dashboard = await User.getDashboard(this.idapp, user.aportador_solidario, user.username, user.aportador_solidario_name_surname);
|
const dashboard = await User.getDashboard(this.idapp, user.aportador_solidario, user.username, user.aportador_solidario_name_surname);
|
||||||
|
const downline = await User.getDownline(this.idapp, user.aportador_solidario, user.username);
|
||||||
|
|
||||||
let numpersone = (dashboard.downline) ? dashboard.downline.length : 0;
|
let numpersone = (downline.downline) ? downline.downline.length : 0;
|
||||||
let invitati_attivi = dashboard.myself.numinvitatiattivi;
|
let invitati_attivi = dashboard.myself.numinvitatiattivi;
|
||||||
mystr = "";
|
mystr = "";
|
||||||
// if (dashboard.aportador) {
|
// if (dashboard.aportador) {
|
||||||
@@ -1295,7 +1296,7 @@ class Telegram {
|
|||||||
mystr += tools.get__('INVITATI_LISTA', this.getlang(msg)) + ':\n';
|
mystr += tools.get__('INVITATI_LISTA', this.getlang(msg)) + ':\n';
|
||||||
|
|
||||||
let index = 1;
|
let index = 1;
|
||||||
dashboard.downline.forEach((user) => {
|
downline.downline.forEach((user) => {
|
||||||
mystr += emoji.get('star-struck') + ` ${index}°: `;
|
mystr += emoji.get('star-struck') + ` ${index}°: `;
|
||||||
mystr += (user.qualified) ? emo.CHECK_VERDE : emo.CROSS_ROSSA;
|
mystr += (user.qualified) ? emo.CHECK_VERDE : emo.CROSS_ROSSA;
|
||||||
mystr += `${user.name} ${user.surname} (${user.username})\n`;
|
mystr += `${user.name} ${user.surname} (${user.username})\n`;
|
||||||
@@ -2115,6 +2116,8 @@ class Telegram {
|
|||||||
}
|
}
|
||||||
if (blocked) {
|
if (blocked) {
|
||||||
User.SetTelegramWasBlocked(this.idapp, id);
|
User.SetTelegramWasBlocked(this.idapp, id);
|
||||||
|
|
||||||
|
// ++Todo: DA FARE ! local_sendMsgTelegramToTheManagers(this.idapp, addtext + text);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user