Sistemazioni...
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user