- Message notify when 'Ask Info' and user is not logged
- Ask Info and Book show message if not logged - TableField fixed and added some features
This commit is contained in:
@@ -97,11 +97,17 @@ const MyEventSchema = new Schema({
|
||||
MyEventSchema.statics.findAllIdApp = function (idapp) {
|
||||
const Event = this;
|
||||
|
||||
const myfind = { idapp };
|
||||
const query = [
|
||||
{ $match: { idapp } },
|
||||
{ $sort: { dateTimeStart: 1 } }
|
||||
];
|
||||
|
||||
return Event
|
||||
.aggregate(query)
|
||||
.then((arrrec) => {
|
||||
return arrrec
|
||||
})
|
||||
|
||||
return Event.find(myfind, (err, arrrec) => {
|
||||
return arrrec
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ sendmsgSchema.statics.findLastGroupByUserIdAndIdApp = function (userId, username
|
||||
// Remove duplicate
|
||||
// Exclude my chat
|
||||
const myarr = arrmsg.filter((ris) => ris._id !== username);
|
||||
console.table(myarr);
|
||||
// console.table(myarr);
|
||||
return myarr
|
||||
|
||||
}).catch((err) => {
|
||||
|
||||
52
server/models/settings.js
Normal file
52
server/models/settings.js
Normal file
@@ -0,0 +1,52 @@
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const SettingsSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
key: {
|
||||
type: String,
|
||||
},
|
||||
type: {
|
||||
type: Number,
|
||||
},
|
||||
value_str: {
|
||||
type: String,
|
||||
},
|
||||
value_date: {
|
||||
type: Date,
|
||||
},
|
||||
value_num: {
|
||||
type: Number,
|
||||
}
|
||||
});
|
||||
|
||||
SettingsSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
SettingsSchema.statics.findAllIdApp = function (idapp) {
|
||||
const Settings = this;
|
||||
|
||||
const myfind = { idapp };
|
||||
|
||||
return Settings.find(myfind, (err, arrrec) => {
|
||||
return arrrec
|
||||
});
|
||||
};
|
||||
|
||||
const Settings = mongoose.model('Settings', SettingsSchema);
|
||||
|
||||
module.exports = { Settings };
|
||||
@@ -92,9 +92,6 @@ var UserSchema = new mongoose.Schema({
|
||||
perm: {
|
||||
type: Number
|
||||
},
|
||||
img: {
|
||||
type: String
|
||||
},
|
||||
ipaddr: {
|
||||
type: String,
|
||||
},
|
||||
@@ -110,7 +107,21 @@ var UserSchema = new mongoose.Schema({
|
||||
},
|
||||
lasttimeonline: {
|
||||
type: Date
|
||||
}
|
||||
},
|
||||
profile: {
|
||||
img: {
|
||||
type: String
|
||||
},
|
||||
cell: {
|
||||
type: String
|
||||
},
|
||||
dateofbirth: {
|
||||
type: Date,
|
||||
},
|
||||
sex: {
|
||||
type: Number,
|
||||
},
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user