Notifications

Settings Notifications
User Panel
This commit is contained in:
Paolo Arena
2022-07-23 17:48:33 +02:00
parent e9ce597027
commit b06f1e4ab8
19 changed files with 472 additions and 121 deletions

View File

@@ -68,6 +68,24 @@ CitySchema.pre('save', async function(next) {
next();
});
CitySchema.statics.getProvinceByIdCity = async function(idcity) {
const myrec = await City.findOne({_id: idcity}).lean();
if (myrec) {
return myrec.prov;
}
return '';
}
CitySchema.statics.getRegionByIdCity = async function(idcity) {
const myrec = await City.findOne({_id: idcity}).lean();
if (myrec) {
return myrec.reg;
}
return '';
}
CitySchema.statics.findByCity = function(mycity) {
let myregexp = new RegExp(mycity.trim().replace(' ', '|'), 'ig');