- aggiornato scheda e rigenera lista
- corretto filtro sulla Collana
This commit is contained in:
@@ -277,7 +277,7 @@ module.exports.executeQueryPickup = async function (idapp, params) {
|
||||
const escapeRegex = w => w.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
|
||||
// 🔹 Pattern per productInfo.name: tutte le parole devono essere presenti
|
||||
const patternAllWords = words.map(w => `(?=.*\\b${escapeRegex(w)}\\b)`).join('') + '.*';
|
||||
const patternAllWords = words.map(w => `(?=.*\\b${escapeRegex(w)})`).join('') + '.*';
|
||||
|
||||
// 🔹 Condizioni per autori
|
||||
let authorConditions = [];
|
||||
@@ -394,13 +394,13 @@ module.exports.executeQueryPickup = async function (idapp, params) {
|
||||
name: '$productInfo.name', // Nome dell'autore
|
||||
authors: '$productInfo.authors',
|
||||
idStatoProdotto: "$productInfo.idStatoProdotto",
|
||||
date_pub: "$productInfo.date_pub",
|
||||
},
|
||||
arrvariazioni: "$arrvariazioni",
|
||||
}
|
||||
},
|
||||
{
|
||||
$sort: {
|
||||
'arrvariazioni.0.quantita': -1, // Ordina per arrvariazioni[0].quantita , decrescente
|
||||
'productInfo.date_pub': -1,
|
||||
'productInfo.name': 1 // Ordina per name in ordine crescente
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user