- aggiunto anche nei beni, servizi e ospitalità la possibilità di aggiungerli come "Gruppo"

This commit is contained in:
Surya Paolo
2025-01-14 18:34:58 +01:00
parent 37970c5c91
commit 08a089881c
23 changed files with 484 additions and 94 deletions

View File

@@ -939,46 +939,59 @@ export default defineComponent({
}
} else if (item.table === shared_consts.TABFILTRI_UTENTE) {
if (item.value === shared_consts.FILTER_USER_SENZA_PROVINCE) {
filtercustom.push({ 'profile.resid_province': { $exists: false } });
} else if (item.value === shared_consts.FILTER_USER_CON_CIRCUITO) {
filtercustom.push({
'profile.mycircuits': { $exists: true, $ne: [] }
});
} else if (item.value === shared_consts.FILTER_USER_ONLINE_6_MESI) {
const numgiorni_attivi = 30 * 6
let daytocheck = new Date();
daytocheck.setDate(daytocheck.getDate() - numgiorni_attivi);
daytocheck.setHours(0, 0, 0, 0)
filtercustom.push({ lasttimeonline: { $gt: daytocheck } })
} else if (item.value === shared_consts.FILTER_USER_SENZA_CIRCUITO) {
filtercustom.push({
$or: [
{ 'profile.mycircuits': { $exists: false } },
{ 'profile.mycircuits': { $eq: [] } }
]
});
} else if (item.value === shared_consts.FILTER_USER_PROVINCE) {
filtercustom.push({ 'profile.resid_province': { $exists: true, $ne: '' } });
} else if (item.value === shared_consts.FILTER_USER_TELEGRAM_BLOCKED) {
filtercustom.push({ 'profile.teleg_id_old': { $gt: 1 } });
} else if (item.value === shared_consts.FILTER_USER_WITHOUT_USERNAME_TELEGRAM) {
filtercustom.push({
$or: [
{ 'profile.username_telegram': { $exists: false } },
{ 'profile.username_telegram': { $exists: true, $eq: '' } }],
item.arrvalue.forEach((myitemsingle: any) => {
if (myitemsingle === shared_consts.FILTER_USER_SENZA_PROVINCE) {
filtercustom.push({ 'profile.resid_province': { $exists: false } });
} else if (myitemsingle === shared_consts.FILTER_USER_CON_CIRCUITO) {
filtercustom.push({
'profile.mycircuits': { $exists: true, $ne: [] }
});
} else if (myitemsingle === shared_consts.FILTER_USER_ONLINE_6_MESI) {
const numgiorni_attivi = 30 * 6
let daytocheck = new Date();
daytocheck.setDate(daytocheck.getDate() - numgiorni_attivi);
daytocheck.setHours(0, 0, 0, 0)
});
filtercustom.push({ lasttimeonline: { $gt: daytocheck } })
} else if (myitemsingle === shared_consts.FILTER_USER_SENZA_CIRCUITO) {
filtercustom.push({
$or: [
{ 'profile.mycircuits': { $exists: false } },
{ 'profile.mycircuits': { $eq: [] } }
]
});
} else if (myitemsingle === shared_consts.FILTER_USER_PROVINCE) {
filtercustom.push({ 'profile.resid_province': { $exists: true, $ne: '' } });
} else if (myitemsingle === shared_consts.FILTER_USER_TELEGRAM_BLOCKED) {
filtercustom.push({ 'profile.teleg_id_old': { $gt: 1 } });
} else if (myitemsingle === shared_consts.FILTER_NOTE) {
filtercustom.push({ 'profile.note': { $exists: true, $ne: '' } });
} else if (myitemsingle === shared_consts.FILTER_SENZA_NOTE) {
filtercustom.push({
$or: [
{ 'profile.note': { $exists: false } },
{ 'profile.note': { $exists: true, $eq: '' } }],
} else if (item.value === shared_consts.FILTER_USER_NO_VERIFIED_APORTADOR) {
filtercustom.push({
verified_by_aportador: { $exists: false },
});
} else if (item.value === shared_consts.FILTER_USER_NO_TELEGRAM_ID) {
filtercustom.push({ 'profile.teleg_id': { $lt: 1 } });
});
} else if (myitemsingle === shared_consts.FILTER_USER_WITHOUT_USERNAME_TELEGRAM) {
filtercustom.push({
$or: [
{ 'profile.username_telegram': { $exists: false } },
{ 'profile.username_telegram': { $exists: true, $eq: '' } }],
});
} else if (myitemsingle === shared_consts.FILTER_USER_NO_VERIFIED_APORTADOR) {
filtercustom.push({
verified_by_aportador: { $exists: false },
});
} else if (myitemsingle === shared_consts.FILTER_USER_NO_TELEGRAM_ID) {
filtercustom.push({ 'profile.teleg_id': { $lt: 1 } });
}
})
}
} else if (item.table === 'cities') {
if (item.value && item.value.hasOwnProperty('_id')) {