Calcolo Hours
This commit is contained in:
@@ -221,6 +221,12 @@ const UserSchema = new mongoose.Schema({
|
||||
manage_telegram: {
|
||||
type: Boolean
|
||||
},
|
||||
resplist: {
|
||||
type: Boolean
|
||||
},
|
||||
workerslist: {
|
||||
type: Boolean
|
||||
},
|
||||
dateofbirth: {
|
||||
type: Date,
|
||||
},
|
||||
@@ -1263,6 +1269,28 @@ 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 })
|
||||
.then((arrrec) => {
|
||||
return (!!arrrec) ? arrrec : null;
|
||||
}).catch((e) => {
|
||||
console.error('getusersRespList', e);
|
||||
});
|
||||
};
|
||||
|
||||
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 })
|
||||
.then((arrrec) => {
|
||||
return (!!arrrec) ? arrrec : null;
|
||||
}).catch((e) => {
|
||||
console.error('getusersWorkersList', e);
|
||||
});
|
||||
};
|
||||
|
||||
UserSchema.statics.getusersManagersAndZoomeri = async function (idapp) {
|
||||
const User = this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user