Strutturato le Traduzioni del Sito Specifico
Inizio creazione di SalviamoIlPianeta.app
This commit is contained in:
@@ -790,7 +790,6 @@ UserSchema.statics.getLangByIndOrder = async function (idapp, ind_order) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
UserSchema.statics.SetLang = async function (idapp, id, lang) {
|
||||
const User = this;
|
||||
|
||||
@@ -969,15 +968,15 @@ UserSchema.statics.getUsersListByParams = function (params) {
|
||||
*/
|
||||
|
||||
UserSchema.statics.getFieldsForSearch = function () {
|
||||
return [{field: 'username', type: tools.FieldType.string},
|
||||
{field: 'name', type: tools.FieldType.string },
|
||||
{field: 'ind_order', type: tools.FieldType.number },
|
||||
{field: 'surname', type: tools.FieldType.string },
|
||||
{field: 'email', type: tools.FieldType.string },
|
||||
{field: 'profile.cell', type: tools.FieldType.string},
|
||||
{field: 'profile.email_paypal', type: tools.FieldType.string},
|
||||
{field: 'profile.username_telegram', type: tools.FieldType.string},
|
||||
{field: 'aportador_solidario', type: tools.FieldType.string}]
|
||||
return [{ field: 'username', type: tools.FieldType.string },
|
||||
{ field: 'name', type: tools.FieldType.string },
|
||||
{ field: 'ind_order', type: tools.FieldType.number },
|
||||
{ field: 'surname', type: tools.FieldType.string },
|
||||
{ field: 'email', type: tools.FieldType.string },
|
||||
{ field: 'profile.cell', type: tools.FieldType.string },
|
||||
{ field: 'profile.email_paypal', type: tools.FieldType.string },
|
||||
{ field: 'profile.username_telegram', type: tools.FieldType.string },
|
||||
{ field: 'aportador_solidario', type: tools.FieldType.string }]
|
||||
};
|
||||
|
||||
UserSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
@@ -1139,6 +1138,96 @@ UserSchema.statics.getUsersQualified = async function (idapp, numinvitati) {
|
||||
|
||||
};
|
||||
|
||||
UserSchema.statics.visuUtentiNonInNavi = async function (idapp) {
|
||||
const User = this;
|
||||
|
||||
const arrusers = await User.find({
|
||||
idapp,
|
||||
$or: [
|
||||
{
|
||||
'profile.special_req': true
|
||||
},
|
||||
{
|
||||
verified_email: true,
|
||||
'profile.teleg_id': { $gt: 0 },
|
||||
'profile.paymenttypes': { "$in": ['paypal'] },
|
||||
'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED,
|
||||
'profile.saw_zoom_presentation': true,
|
||||
'profile.my_dream': { $exists: true },
|
||||
$and: [
|
||||
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.my_dream" }, 10] } },
|
||||
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.email_paypal" }, 6] } }
|
||||
],
|
||||
}]
|
||||
|
||||
}, {
|
||||
name: 1,
|
||||
surname: 1,
|
||||
username: 1,
|
||||
ind_order: 1,
|
||||
});
|
||||
|
||||
|
||||
let num = 0;
|
||||
let innave = 0;
|
||||
let noninnave = 0;
|
||||
let mystr = 'visuUtentiNonInNavi: ' + tools.ACAPO;
|
||||
let reg = 0;
|
||||
let num0inv = 0;
|
||||
let num1inv = 0;
|
||||
let num2inv = 0;
|
||||
let numnoinlista = 0;
|
||||
|
||||
for (const user of arrusers) {
|
||||
user.numinvitati = await User.getnumInvitati(idapp, user.username);
|
||||
reg++;
|
||||
let mianave = await Nave.findOne({ idapp, ind_order: user.ind_order });
|
||||
let mialistaingresso = await ListaIngresso.findOne({ idapp, ind_order: user.ind_order });
|
||||
let trovato = false;
|
||||
if (!mianave) {
|
||||
mystr += user.username + ' ' + user.name + ' ' + user.surname + ' [' + user.ind_order + '] [inv=' + user.numinvitati + ']'
|
||||
noninnave++;
|
||||
trovato = true;
|
||||
} else {
|
||||
innave++;
|
||||
}
|
||||
|
||||
if (!mialistaingresso) {
|
||||
mystr += ' NO IN LISTA INGRESSO!';
|
||||
trovato = true;
|
||||
numnoinlista++;
|
||||
}
|
||||
|
||||
if (trovato)
|
||||
mystr += tools.ACAPO;
|
||||
|
||||
if (user.numinvitati === 0) {
|
||||
num0inv++;
|
||||
}
|
||||
if (user.numinvitati === 1) {
|
||||
num1inv++;
|
||||
}
|
||||
if (user.numinvitati >= 2) {
|
||||
num2inv++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mystrstart = 'Registrati: ' + reg + tools.ACAPO;
|
||||
mystrstart += '0 Invitati: ' + num0inv + tools.ACAPO;
|
||||
mystrstart += '1 Invitato: ' + num1inv + tools.ACAPO;
|
||||
mystrstart += '2 o più Invitati: ' + num2inv + tools.ACAPO;
|
||||
mystrstart += 'Presente in Nave: ' + innave + tools.ACAPO;
|
||||
mystrstart += 'Non in Nave: ' + noninnave + tools.ACAPO;
|
||||
mystrstart += 'Non in Lista Imbarco: ' + numnoinlista + tools.ACAPO;
|
||||
|
||||
mystrstart += tools.ACAPO;
|
||||
|
||||
mystr = mystrstart + mystr;
|
||||
|
||||
return { num, mystr };
|
||||
};
|
||||
|
||||
UserSchema.statics.getNumUsersQualified = async function (idapp, numinvitati) {
|
||||
|
||||
arrrec = await this.getUsersQualified(idapp, numinvitati);
|
||||
|
||||
Reference in New Issue
Block a user