- newsletter: prende la lista utenti (flag news_on)
- Abilita a Tutti la Newsletter news_on - isCommerciale - JobsInProgress - PCB: Corretto Totali che era a zero
This commit is contained in:
@@ -39,6 +39,41 @@ MailingListSchema.statics.findAllIdAppSubscribed = function (idapp) {
|
||||
return tools.findAllQueryIdApp(User, myfind);
|
||||
};
|
||||
|
||||
MailingListSchema.statics.findAllIdAppDiarioSubscr = function (idapp) {
|
||||
|
||||
const myfind = {
|
||||
idapp,
|
||||
diario_on: true,
|
||||
$or: [
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
$or: [
|
||||
{ email_errata: { $exists: false } },
|
||||
{ email_errata: { $exists: true, $ne: true } }],
|
||||
};
|
||||
|
||||
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
|
||||
|
||||
return tools.findAllQueryIdApp(User, myfind);
|
||||
};
|
||||
MailingListSchema.statics.findAllIdAppDiarioSubscr = function (idapp) {
|
||||
|
||||
const myfind = {
|
||||
idapp,
|
||||
test: true,
|
||||
$or: [
|
||||
{ deleted: { $exists: false } },
|
||||
{ deleted: { $exists: true, $eq: false } }],
|
||||
$or: [
|
||||
{ email_errata: { $exists: false } },
|
||||
{ email_errata: { $exists: true, $ne: true } }],
|
||||
};
|
||||
|
||||
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
|
||||
|
||||
return tools.findAllQueryIdApp(User, myfind);
|
||||
};
|
||||
|
||||
MailingListSchema.statics.getnumSent = async function (idapp, idUser) {
|
||||
|
||||
const myfind = { idapp, news_on: true, lastid_newstosent: idUser };
|
||||
|
||||
Reference in New Issue
Block a user