Notifications
Settings Notifications User Panel
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user