- Permissions table (probably I'll change for others uses)

- Added CDateTime component (to save in the db)... in the component CGridTableRec and for CEventsCalendar
This commit is contained in:
Paolo Arena
2019-10-28 16:01:28 +01:00
parent 5307c04151
commit 93ccc73517
7 changed files with 142 additions and 11 deletions

View File

@@ -358,13 +358,27 @@ UserSchema.statics.getUsersListByParams = function (params) {
* @returns {Object} Object -> `{ rows, count }`
*/
UserSchema.statics.getFieldsForSearch = function () {
return ['name', 'surname', 'email']
};
UserSchema.statics.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
if (tools.INITDB_FIRSTIME) {
console.log(' createIndex User Index...');
// UserSchema.index({ username: 'text', name: 'text', surname: 'text', email: 'text' });
// UserSchema.index({ name: 'name' });
// UserSchema.index({ name: 1 });
// UserSchema.index({ surname: 1 });
}
const User = mongoose.model('User', UserSchema);
class Hero {
constructor(name, level) {
this.name = name;