- la ricerca trova anche i "On Line" anche se metto la provincia o regione.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
list: [
|
||||
{_id: 1, descr: 'Di Persona', icon:'fas fa-people-carry' },
|
||||
{_id: 2, descr: 'On Line', icon:'fas fa-desktop'},
|
||||
{_id: 1, descr: 'Di Persona', icon:'fas fa-people-carry', color:'green-8' },
|
||||
{_id: 2, descr: 'On Line', icon:'fas fa-desktop', color: 'indigo-7'},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -2110,6 +2110,21 @@ module.exports = {
|
||||
return myquery;
|
||||
},
|
||||
|
||||
contieneIdStatusSkill(filtersearch) {
|
||||
for (let i = 0; i < filtersearch.length; i++) {
|
||||
const obj = filtersearch[i];
|
||||
if (obj.$or) {
|
||||
for (let j = 0; j < obj.$or.length; j++) {
|
||||
const condition = obj.$or[j];
|
||||
if (condition.idStatusSkill) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
addNumFavoriteAndBookmarkToQuery(idapp, numtab) {
|
||||
|
||||
let query = [];
|
||||
@@ -2881,11 +2896,26 @@ module.exports = {
|
||||
|
||||
if (params.filtersearch3and) {
|
||||
if (params.filtersearch3and.length > 0) {
|
||||
query.push({ $match: { $and: params.filtersearch3and } });
|
||||
// Se c'è statusskill allora glielo metto in OR
|
||||
|
||||
if (params.table === 'myskills' && params.filtersearch && !this.contieneIdStatusSkill(params.filtersearch)) {
|
||||
|
||||
query.push({
|
||||
$match: {
|
||||
$or: [
|
||||
{ $and: params.filtersearch3and },
|
||||
{ idStatusSkill: { $in: [2]} }
|
||||
]
|
||||
}
|
||||
});
|
||||
} else {
|
||||
query.push({ $match: { $and: params.filtersearch3and } });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (params.filter && params.fieldsearch_last) {
|
||||
const querytemp = this.getFilterParam(params.filter,
|
||||
params.fieldsearch_last);
|
||||
|
||||
Reference in New Issue
Block a user