Grosse Modifiche Completate !
This commit is contained in:
@@ -125,13 +125,13 @@ function getQueryProj(myfilter) {
|
||||
}
|
||||
},
|
||||
{
|
||||
$unwind: "$mylista"
|
||||
$replaceRoot: { newRoot: { $mergeObjects: [ { $arrayElemAt: [ "$mylista", 0 ] }, "$$ROOT" ] } }
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: "users",
|
||||
as: "user",
|
||||
let: {username: '$mylista.username' },
|
||||
let: {username: '$username' },
|
||||
pipeline: [
|
||||
{
|
||||
$match: {
|
||||
@@ -196,6 +196,7 @@ NavePersistenteSchema.statics.getListaNavi = function (idapp) {
|
||||
col: 1,
|
||||
riga1don: 1,
|
||||
col1don: 1,
|
||||
date_gift_chat_open: 1,
|
||||
date_start: 1,
|
||||
provvisoria: 1,
|
||||
DoniConfermati: 1,
|
||||
@@ -252,6 +253,10 @@ NavePersistenteSchema.statics.getLastRigaCol = async function (idapp) {
|
||||
return NavePersistente.findOne({ idapp }).sort({ _id: -1 });
|
||||
};
|
||||
|
||||
NavePersistenteSchema.statics.getLastRigaColDefinitiva = async function (idapp) {
|
||||
return NavePersistente.findOne({ idapp, provvisoria: false }).sort({ riga: -1, col: -1 });
|
||||
};
|
||||
|
||||
NavePersistenteSchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
const myrec = await NavePersistente.findOne().limit(1).sort({ _id: -1 });
|
||||
|
||||
Reference in New Issue
Block a user