Sistemazioni...

This commit is contained in:
Paolo Arena
2020-07-02 22:00:58 +02:00
parent 92d426c3a6
commit 6e8122db86
13 changed files with 454 additions and 171 deletions

View File

@@ -78,6 +78,9 @@ const FlottaSchema = new mongoose.Schema({
email_paypal: {
type: String,
},
revolut: {
type: String,
},
note_payment: {
type: String,
},
@@ -111,6 +114,7 @@ function getQueryProj(myfilter) {
username: 1,
'profile.paymenttypes': 1,
'profile.email_paypal': 1,
'profile.revolut': 1,
'profile.cell': 1,
made_gift: 1,
commento_al_sognatore: 1,
@@ -317,6 +321,31 @@ FlottaSchema.statics.getFlottaByNavePersistente = async function (idapp, naveper
return myflotta;
};
FlottaSchema.statics.getStrFlotta = function (flotta) {
return `Flotta ${flotta.riga}.${Math.ceil(flotta.col_prima / 8)} - ${flotta.riga}.${Math.ceil(flotta.col_ultima / 8)}: Sognatore: ${flotta.sognatore_nomecognome}`;
};
FlottaSchema.statics.getFlottaByRigaColDonatore = async function (idapp, riga, col) {
const Flotta = this;
let mypos = {
idapp,
riga,
col,
numup: 3
};
tools.getRigaColByPosUp(mypos);
const myflotta = await Flotta.findOne({ idapp, riga: mypos.riga,
$and: [
{ col_prima: { $lte: col } },
{ col_ultima: { $gte: col } } ]
});
return myflotta;
};
const Flotta = mongoose.model('Flotta', FlottaSchema);