++ aggiunta la prenotazione negli eventi. con la lista degli utenti.
This commit is contained in:
@@ -149,18 +149,13 @@ MyHospSchema.statics.executeQueryTable = function (idapp, params, user) {
|
||||
MyHospSchema.statics.getMyRecById = function (idapp, id) {
|
||||
const MyHosp = this;
|
||||
|
||||
const myparsid = { '_id': id };
|
||||
const myparsid = { '_id': id, idapp };
|
||||
|
||||
let query = [
|
||||
{
|
||||
'$match':
|
||||
myparsid,
|
||||
},
|
||||
{
|
||||
'$match': {
|
||||
'idapp': idapp,
|
||||
},
|
||||
},
|
||||
{
|
||||
'$sort': {
|
||||
'desc': 1,
|
||||
@@ -307,11 +302,11 @@ MyHospSchema.statics.getMyRecById = function (idapp, id) {
|
||||
const objadd = tools.addNumFavoriteAndBookmarkToQuery(idapp, numtab);
|
||||
query = [...query, ...objadd.query];
|
||||
|
||||
query = [...query,
|
||||
{
|
||||
$project: this.getProject(objadd.proj),
|
||||
}
|
||||
];
|
||||
const toadd = {
|
||||
$project: this.getProject(objadd.proj),
|
||||
};
|
||||
|
||||
query = [...query, {...toadd}];
|
||||
|
||||
return MyHosp.aggregate(query).then((rec) => {
|
||||
return rec ? rec[0] : null;
|
||||
|
||||
Reference in New Issue
Block a user