Aggiornamento cataloghi...
This commit is contained in:
@@ -819,6 +819,7 @@ module.exports.getArrCatProds = async function (idapp, cosa) {
|
||||
]
|
||||
}
|
||||
}]
|
||||
|
||||
} else {
|
||||
addquery = [{ $match: { idapp } }];
|
||||
}
|
||||
@@ -841,7 +842,23 @@ module.exports.getArrCatProds = async function (idapp, cosa) {
|
||||
}
|
||||
},
|
||||
{ $unwind: "$category" },
|
||||
{ $group: { _id: "$category._id", name: { $first: "$category.name" } } },
|
||||
{
|
||||
$group: {
|
||||
_id: "$category._id",
|
||||
name: { $first: "$category.name" },
|
||||
idapp: { $first: "$category.idapp" },
|
||||
idArgomento: { $first: "$category.idArgomento" }
|
||||
}
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
$or: [
|
||||
{ idapp: { $ne: tools.MACRO } },
|
||||
{ idapp: tools.MACRO, idArgomento: { $exists: true, $gt: 0 } }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
{ $sort: { name: 1 } }
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user