Modifiche ultimate: Grafica Navi , Prenota un Altro Viaggio.
This commit is contained in:
@@ -445,12 +445,12 @@ UserSchema.statics.getUserShortDataByUsername = async function (idapp, username)
|
||||
return myrec
|
||||
};
|
||||
|
||||
UserSchema.statics.getDownlineByUsername = async function (idapp, username) {
|
||||
UserSchema.statics.getDownlineByUsername = async function (idapp, username, includemyself) {
|
||||
|
||||
if (username === undefined)
|
||||
return null;
|
||||
|
||||
const arrrec = await ListaIngresso.getInvitati(idapp, username,
|
||||
const arrrec = await ListaIngresso.getInvitati(idapp, username, includemyself,
|
||||
{
|
||||
index: 1,
|
||||
lang: 1,
|
||||
@@ -474,12 +474,18 @@ UserSchema.statics.getDownlineByUsername = async function (idapp, username) {
|
||||
}
|
||||
);
|
||||
|
||||
// Ottieni gli invitati che ancora non hanno un'imbarco
|
||||
const arrinv = await User.find({
|
||||
let myq = {
|
||||
idapp,
|
||||
aportador_solidario: username,
|
||||
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||
});
|
||||
};
|
||||
|
||||
if (!includemyself) {
|
||||
myq = { ...myq, username: {$ne: username} }
|
||||
}
|
||||
|
||||
// Ottieni gli invitati che ancora non hanno un'imbarco
|
||||
const arrinv = await User.find(myq);
|
||||
|
||||
for (const inv of arrinv) {
|
||||
if (!arrrec.find((rec) => rec.username === inv.username))
|
||||
@@ -1153,16 +1159,16 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
||||
if (!!arrap)
|
||||
dashboard.numpeople_aportador = arrap.length;
|
||||
|
||||
dashboard.downline = await User.getDownlineByUsername(idapp, username);
|
||||
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);
|
||||
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);
|
||||
dashboard.downbyuser[down2.username] = await User.getDownlineByUsername(idapp, down2.username, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user