vers: 1.1.3
- aggiornato ncu -u
This commit is contained in:
@@ -1048,6 +1048,13 @@ MovementSchema.statics.getLastN_Transactions = async function (idapp, numtransaz
|
||||
|
||||
*/
|
||||
|
||||
lastNtransac.forEach(function (mov) {
|
||||
let ris = tools.getStringaConto(mov)
|
||||
mov.userfrom = ris.userfrom
|
||||
mov.userto = ris.userto
|
||||
mov.tipocontofrom = ris.tipocontofrom
|
||||
mov.tipocontoto = ris.tipocontoto
|
||||
});
|
||||
|
||||
return lastNtransac;
|
||||
};
|
||||
|
||||
@@ -67,16 +67,9 @@ const StatSchema = new Schema({
|
||||
},
|
||||
});
|
||||
|
||||
StatSchema.statics.updateStats = async function (datastat) {
|
||||
|
||||
datastat.last_transactions.forEach(function (mov) {
|
||||
let ris = tools.getStringaConto(mov)
|
||||
mov.userfrom = ris.userfrom
|
||||
mov.userto = ris.userto
|
||||
mov.tipocontofrom = ris.tipocontofrom
|
||||
mov.tipocontoto = ris.tipocontoto
|
||||
});
|
||||
StatSchema.statics.updateStats = async function (idapp, datastat) {
|
||||
|
||||
datastat.last_transactions = await Movement.getLastN_Transactions(idapp, 5);
|
||||
|
||||
return datastat;
|
||||
};
|
||||
@@ -112,7 +105,6 @@ StatSchema.statics.calculateStats = async function (idapp) {
|
||||
num_circuiti: await Circuit.getnumCircuits(idapp),
|
||||
num_circuiti_attivi: await Circuit.getnumActiveCircuits(idapp),
|
||||
num_annunci: await User.getnumAnnunci(idapp),
|
||||
last_transactions: await Movement.getLastN_Transactions(idapp, 10),
|
||||
};
|
||||
|
||||
// Trova il record di oggi:
|
||||
@@ -169,7 +161,7 @@ StatSchema.statics.getStats = async function (idapp) {
|
||||
datastat = rec;
|
||||
}
|
||||
|
||||
datastat = await Stat.updateStats(datastat);
|
||||
datastat = await Stat.updateStats(idapp, datastat);
|
||||
|
||||
return datastat;
|
||||
|
||||
|
||||
@@ -798,6 +798,7 @@ module.exports = {
|
||||
baseurl: tools.getHostByIdApp(idapp),
|
||||
dataemail: await this.getdataemail(idapp),
|
||||
ordernumber: orders.numorder,
|
||||
dirimg: 'upload/products/',
|
||||
user,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user