- ordinamento aggiornare la pagina "templates" per Fatturati ultimo anno

- bestseller
This commit is contained in:
Surya Paolo
2025-05-02 10:10:11 +02:00
parent fcc3755c19
commit 192fd4706c
6 changed files with 32 additions and 3 deletions

View File

@@ -34,6 +34,9 @@ const CatProdSchema = new Schema({
color: {
type: String,
},
quanti: {
type: Number,
}
});
CatProdSchema.statics.getAllCategories = function (callback) {
@@ -148,6 +151,13 @@ CatProdSchema.statics.getCatProdWithTitleCount = async function (idapp) {
const result = await CatProd.aggregate(myquery);
for (const record of result) {
await CatProd.updateOne(
{ _id: record._id },
{ $set: { quanti: record.quanti } }
);
}
return result;
} catch (error) {
console.error('Error retrieving CatProd with title count:', error);