- Visu Saldo su Home

- SendRisTo
- Movimenti conto Comunitario
- Profilo
This commit is contained in:
Surya Paolo
2023-03-17 19:07:31 +01:00
parent e705594294
commit 7482b65743
10 changed files with 70 additions and 18 deletions

View File

@@ -122,13 +122,13 @@ MovementSchema.statics.addMov = async function (idapp, accountFromIdTable, accou
}
};
MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username, circuitId) {
MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username, groupname, contocom, circuitId) {
try {
if (!circuitId) {
return [];
}
const myaccount = await Account.getAccountByUsernameAndCircuitId(idapp, username, circuitId, '');
const myaccount = await Account.getAccountByUsernameAndCircuitId(idapp, username, circuitId, false, groupname, contocom);
if (myaccount) {
@@ -363,10 +363,10 @@ MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username
'userto.username': 1,
'userto.profile.img': 1,
'groupfrom.groupname': 1,
'groupfrom.descr': 1,
'groupfrom.title': 1,
'groupfrom.photos': 1,
'groupto.groupname': 1,
'groupto.descr': 1,
'groupto.title': 1,
'groupto.photos': 1,
'contocomfrom.path': 1,
'contocomfrom.name': 1,
@@ -387,6 +387,7 @@ MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username
return [];
};
MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function (idapp, circuitId) {
try {
@@ -635,13 +636,15 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function (idapp,
'userto.username': 1,
'userto.profile.img': 1,
'groupfrom.groupname': 1,
'groupfrom.descr': 1,
'groupfrom.title': 1,
'groupto.groupname': 1,
'groupto.descr': 1,
'groupto.title': 1,
'contocomfrom.path': 1,
'contocomfrom.name': 1,
'contocomfrom.title': 1,
'contocomto.path': 1,
'contocomto.name': 1,
'contocomto.title': 1,
},
},
@@ -659,7 +662,7 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function (idapp,
MovementSchema.statics.getMovsByCircuitId = async function (idapp, username, circuitId) {
const MyMovement = this;
const myquery = await MyMovement.getQueryMovsByCircuitId(idapp, username, circuitId);
const myquery = await MyMovement.getQueryMovsByCircuitId(idapp, username, '', '', circuitId);
if (myquery && myquery.length > 0) {
ris = await MyMovement.aggregate(myquery);