- corretto scheda prodotto, record salvato
This commit is contained in:
@@ -32,6 +32,9 @@ const CatalogSchema = new Schema({
|
||||
idCollane: [{
|
||||
type: String,
|
||||
}],
|
||||
idTipoFormato: [{
|
||||
type: Number,
|
||||
}],
|
||||
|
||||
argomenti: [{
|
||||
type: String,
|
||||
|
||||
@@ -256,7 +256,7 @@ CitySchema.statics.insertGeojsonToMongoDB = async function (nomefilejson) {
|
||||
|
||||
if (reccity) {
|
||||
const ris = await City.updateOne({ _id: reccity._id }, { $set: { geojson: citta } });
|
||||
if (ris.acknowledged === 1) {
|
||||
if (ris.acknowledged) {
|
||||
inseriti++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ const catalogo = new Schema(
|
||||
argomenti: [{ type: String }],
|
||||
idCollane: [{ type: String }],
|
||||
idTipologia: [{ type: Number }],
|
||||
idTipoFormato: [{ type: Number }],
|
||||
sort_field: { type: String },
|
||||
sort_dir: { type: Number },
|
||||
pdf: { type: Boolean },
|
||||
|
||||
@@ -130,7 +130,8 @@ const scheletroScheda = {
|
||||
|
||||
productTypes: [{ type: Number }],
|
||||
excludeproductTypes: [{ type: Number }],
|
||||
idTipologia: [{ type: Number }],
|
||||
idTipologie: [{ type: Number }],
|
||||
idTipoFormato: [{ type: Number }],
|
||||
editore: [{ type: String }],
|
||||
argomenti: [{ type: String }],
|
||||
idCollane: [{ type: String }],
|
||||
|
||||
@@ -112,6 +112,20 @@ const productSchema = new Schema({
|
||||
eta: {
|
||||
type: String
|
||||
},
|
||||
verificaprod: {
|
||||
esito: {
|
||||
type: Number,
|
||||
},
|
||||
data: {
|
||||
type: Date,
|
||||
},
|
||||
username: {
|
||||
type: String,
|
||||
},
|
||||
note: {
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
}
|
||||
],
|
||||
price_acquistato: {
|
||||
|
||||
@@ -459,12 +459,14 @@ module.exports.updateProductInfoByStats = async function (idapp) {
|
||||
const T_WEB_ArticoliFatturati = require('./t_web_articolifatturati');
|
||||
const T_WEB_Ordini = require('./t_web_ordini');
|
||||
|
||||
const statistics = await T_WEB_ArticoliFatturati.getStatistics();
|
||||
|
||||
mylog = "Inizio Aggiornamento Statistiche... \n";
|
||||
mylogtot += mylog;
|
||||
console.log(mylog);
|
||||
|
||||
let countUpdate = 0;
|
||||
|
||||
countUpdate = await T_WEB_ArticoliFatturati.updateStatisticsFatt('', idapp, true);
|
||||
|
||||
// Itera sui risultati e aggiorna productInfo
|
||||
|
||||
mylog = `Aggiornati ${countUpdate} record di productInfo`;
|
||||
|
||||
@@ -87,13 +87,16 @@ module.exports.updateStatisticsOrders = async function (CodArticoloGM, idapp, up
|
||||
try {
|
||||
let myquery = [];
|
||||
|
||||
// Query di aggregazione per calcolare le statistiche
|
||||
myquery.push(
|
||||
{
|
||||
$match: {
|
||||
CodArticoloGM: CodArticoloGM,
|
||||
},
|
||||
});
|
||||
if (CodArticoloGM) {
|
||||
// Query di aggregazione per calcolare le statistiche
|
||||
myquery.push(
|
||||
{
|
||||
$match: {
|
||||
CodArticoloGM: CodArticoloGM,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
myquery.push(
|
||||
{
|
||||
$group: {
|
||||
|
||||
Reference in New Issue
Block a user