- Nuovi Passi da completare: Leggere le Linee Guida e accettare le condizioni

- Aggiunti i Video e confermare di averli visti
 - In "La tua Lavagna" sono stati aggiunti come requisiti: (Accetto le Linee Guida e Vedo il Video di AYNI)
 - Aggiunto bottone "Invita Persone": apre la pagina dove c'è il messaggio da inviare alle persone.
 - La nuova pagina di registrazione https://test.gifteconomy.app/signup/paoloar77, comprende ora il testo delle Linee Guida + i Video, ed in fondo i campi per registrarsi.
This commit is contained in:
Paolo Arena
2020-02-07 22:08:46 +01:00
parent a8bec7686a
commit eccb5bbb57
20 changed files with 403 additions and 135 deletions

View File

@@ -172,6 +172,9 @@ const UserSchema = new mongoose.Schema({
my_dream: {
type: String,
},
saw_and_accepted: {
type: Number,
},
saw_zoom_presentation: {
type: Boolean
},
@@ -324,10 +327,10 @@ UserSchema.statics.findByUsername = function (idapp, username) {
});
};
UserSchema.statics.getUserShortDataByUsername = function (idapp, username) {
UserSchema.statics.getUserShortDataByUsername = async function (idapp, username) {
const User = this;
return User.findOne({
const myrec = await User.findOne({
'idapp': idapp,
'username': username,
}, {
@@ -338,6 +341,7 @@ UserSchema.statics.getUserShortDataByUsername = function (idapp, username) {
verified_email: 1,
'profile.teleg_id': 1,
'profile.saw_zoom_presentation': 1,
'profile.saw_and_accepted': 1,
'profile.email_paypal': 1,
'profile.my_dream': 1,
'profile.paymenttypes': 1,
@@ -354,11 +358,18 @@ UserSchema.statics.getUserShortDataByUsername = function (idapp, username) {
return null;
}
});
if (myrec) {
myrec.numinvitati = await User.getnumInvitati(idapp, myrec.username);
myrec.numinvitatiattivi = await User.getnumInvitatiAttivi(idapp, myrec.username);
}
return myrec
};
UserSchema.statics.getDownlineByUsername = function (idapp, username) {
UserSchema.statics.getDownlineByUsername = async function (idapp, username) {
const User = this;
return User.find({
const arrrec = await User.find({
'idapp': idapp,
'aportador_solidario': username,
}, {
@@ -370,6 +381,7 @@ UserSchema.statics.getDownlineByUsername = function (idapp, username) {
verified_email: 1,
'profile.teleg_id': 1,
'profile.saw_zoom_presentation': 1,
'profile.saw_and_accepted': 1,
'profile.email_paypal': 1,
'profile.my_dream': 1,
'profile.paymenttypes': 1,
@@ -378,13 +390,18 @@ UserSchema.statics.getDownlineByUsername = function (idapp, username) {
date_reg: 1,
img: 1
}, (err, arrrec) => {
for (const rec of arrrec) {
rec.numinvitatiattivi = User.getnumInvitatiAttivi(idapp, rec.username);
}
return arrrec
return arrrec;
});
if (!!arrrec) {
for (const rec of arrrec) {
rec._doc.numinvitati = await User.getnumInvitati(idapp, rec.username);
rec._doc.numinvitatiattivi = await User.getnumInvitatiAttivi(idapp, rec.username);
}
}
return arrrec
};
@@ -396,6 +413,7 @@ UserSchema.statics.getnumInvitatiAttivi = function (idapp, username) {
aportador_solidario: username,
'profile.teleg_id': { $gt: 1 },
'profile.saw_zoom_presentation': true,
'profile.saw_and_accepted': true,
});
};
@@ -602,7 +620,7 @@ UserSchema.statics.getusersManagers = async function (idapp) {
UserSchema.statics.getUsersTelegALL = async function (idapp) {
const User = this;
return await User.find({ idapp, 'profile.teleg_id': { $gt: 0 } }, { 'profile.teleg_id': 1 })
return await User.find({ idapp, 'profile.teleg_id': { $gt: 0 } }, { 'profile.teleg_id': 1, perm: 1 })
.then((arrrec) => {
return (!!arrrec) ? arrrec : null;
}).catch((e) => {
@@ -729,7 +747,7 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
dashboard.myself = await User.getUserShortDataByUsername(idapp, username);
// Data of my Aportador
dashboard.aportador = await User.getUserShortDataByUsername(idapp, aportador_solidario);
if (dashboard.aportador === undefined ) {
if (dashboard.aportador === undefined) {
dashboard.aportador = await ExtraList.getUserNotRegisteredByNameSurname(idapp, aportador_solidario_nome_completo);
}
@@ -827,6 +845,14 @@ UserSchema.statics.getUsersZoom = async function (idapp) {
return await User.count(myfind);
};
UserSchema.statics.getSaw_and_Accepted = async function (idapp) {
const User = this;
const myfind = { idapp, 'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED };
return await User.count(myfind);
};
UserSchema.statics.getUsersDreams = async function (idapp) {
const User = this;