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

View File

@@ -30,6 +30,9 @@ const CollanaSchema = new Schema({
enabledAlFresco: { enabledAlFresco: {
type: Boolean, type: Boolean,
}, },
quanti: {
type: Number,
},
}); });
@@ -101,6 +104,13 @@ module.exports.getCollaneWithTitleCount = async function (idapp) {
const result = await Collana.aggregate(myquery); const result = await Collana.aggregate(myquery);
for (const record of result) {
await Collana.updateOne(
{ _id: record._id },
{ $set: { quanti: record.quanti } }
);
}
return result; return result;
} catch (error) { } catch (error) {
console.error('Error retrieving idCollana with title count:', error); console.error('Error retrieving idCollana with title count:', error);

View File

@@ -82,7 +82,7 @@ const INovita = new Schema(
const IBestseller = new Schema( const IBestseller = new Schema(
{ {
show: Boolean, show: Boolean,
primiNInClassifica: Number, quantiFattRaggiunti: Number,
} }
); );

View File

@@ -24,6 +24,9 @@ const PublisherSchema = new Schema({
img: { img: {
type: String, type: String,
}, },
quanti: {
type: Number,
},
}); });
var Publisher = module.exports = mongoose.model('Publisher', PublisherSchema); var Publisher = module.exports = mongoose.model('Publisher', PublisherSchema);
@@ -92,6 +95,13 @@ module.exports.getEditoriWithTitleCount = async function (idapp) {
const result = await Publisher.aggregate(myquery); const result = await Publisher.aggregate(myquery);
for (const record of result) {
await Publisher.updateOne(
{ _id: record._id },
{ $set: { quanti: record.quanti } }
);
}
return result; return result;
} catch (error) { } catch (error) {
console.error('Error retrieving idCollana with title count:', error); console.error('Error retrieving idCollana with title count:', error);

View File

@@ -119,7 +119,6 @@ module.exports = {
{ _id: 117, reg: 'LAZ', prov: 'RM', descr: 'Roma Nord-Ovest', card: 'NORD-OVEST', link_grp: 'https://t.me/c/1614195634/62?thread=47', link_telegram: '' }, { _id: 117, reg: 'LAZ', prov: 'RM', descr: 'Roma Nord-Ovest', card: 'NORD-OVEST', link_grp: 'https://t.me/c/1614195634/62?thread=47', link_telegram: '' },
{ _id: 118, reg: 'LAZ', prov: 'RM', descr: 'Roma Sud e Litorale', card: 'SUD', link_grp: 'https://t.me/c/1614195634/67?thread=43', link_telegram: '' }, { _id: 118, reg: 'LAZ', prov: 'RM', descr: 'Roma Sud e Litorale', card: 'SUD', link_grp: 'https://t.me/c/1614195634/67?thread=43', link_telegram: '' },
{ _id: 119, reg: 'PUG', prov: 'VAL', descr: 'Valle D\'Itria', link_grp: 'https://t.me/progettoriso/7016?thread=7015', link_telegram: '' }, { _id: 119, reg: 'PUG', prov: 'VAL', descr: 'Valle D\'Itria', link_grp: 'https://t.me/progettoriso/7016?thread=7015', link_telegram: '' },
{ _id: 120, reg: 'SAR', prov: 'SUS', descr: 'Sud Sardegna', link_grp: 'https://t.me/c/1614195634/552?thread=545', link_telegram: '' },
{ _id: 121, reg: 'ITA', prov: 'ITA', descr: 'Italia', link_grp: '', link_telegram: '' }, { _id: 121, reg: 'ITA', prov: 'ITA', descr: 'Italia', link_grp: '', link_telegram: '' },
{ _id: 122, reg: 'LOM', prov: 'MI', descr: 'Milano Est', card: 'EST', link_grp: '', link_telegram: '' }, { _id: 122, reg: 'LOM', prov: 'MI', descr: 'Milano Est', card: 'EST', link_grp: '', link_telegram: '' },
], ],

View File

@@ -1 +1 @@
1.2.34 1.2.35