Reportistica Ore 2

This commit is contained in:
Paolo Arena
2021-02-24 04:48:31 +01:00
parent 14a3292da2
commit 39c08afb95
13 changed files with 427 additions and 56 deletions

View File

@@ -1272,7 +1272,7 @@ UserSchema.statics.getusersManagers = async function (idapp) {
UserSchema.statics.getusersRespList = async function (idapp) {
const User = this;
return await User.find({ idapp, 'profile.resplist': true }, { _id:1, username: 1, name: 1, surname: 1 })
return await User.find({ idapp, 'profile.resplist': true }, { _id: 1, username: 1, name: 1, surname: 1 })
.then((arrrec) => {
return (!!arrrec) ? arrrec : null;
}).catch((e) => {
@@ -1283,7 +1283,7 @@ UserSchema.statics.getusersRespList = async function (idapp) {
UserSchema.statics.getusersWorkersList = async function (idapp) {
const User = this;
return await User.find({ idapp, 'profile.workerslist': true }, { _id:1, username: 1, name: 1, surname: 1 })
return await User.find({ idapp, 'profile.workerslist': true }, { _id: 1, username: 1, name: 1, surname: 1 })
.then((arrrec) => {
return (!!arrrec) ? arrrec : null;
}).catch((e) => {
@@ -1892,6 +1892,18 @@ UserSchema.statics.getUsersZoom = async function (idapp) {
return await User.count(myfind);
};
UserSchema.statics.getUsersResidenti = async function (idapp) {
const User = this;
const myfind = {
idapp,
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
'profile.socioresidente': { $exists: true, $eq: true }
};
return await User.find(myfind, {username: 1, name: 1, surname: 1});
};
UserSchema.statics.getSaw_and_Accepted = async function (idapp) {
const User = this;