- newsletter: prende la lista utenti (flag news_on)
- Abilita a Tutti la Newsletter news_on - isCommerciale - JobsInProgress - PCB: Corretto Totali che era a zero
This commit is contained in:
@@ -21,6 +21,7 @@ const CatProdSchema = new Schema({
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
index: 1,
|
||||
},
|
||||
descr_estesa: {
|
||||
type: String,
|
||||
@@ -100,7 +101,7 @@ CatProdSchema.statics.updateCatDeleteEmpty = async function (idapp) {
|
||||
|
||||
};
|
||||
|
||||
CatProdSchema.statics.getCatProdWithTitleCount = async function (idapp) {
|
||||
CatProdSchema.statics.getCatProdWithTitleCount = async function (idapp, updatedata) {
|
||||
try {
|
||||
|
||||
const myquery = [
|
||||
@@ -151,11 +152,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 } }
|
||||
);
|
||||
if (updatedata) {
|
||||
for (const record of result) {
|
||||
await CatProd.updateOne(
|
||||
{ _id: record._id },
|
||||
{ $set: { quanti: record.quanti } }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user