++ su "Friends" la ricerca per username Telegram e nome e cognome
This commit is contained in:
@@ -6,10 +6,10 @@ mongoose.level = 'F';
|
|||||||
|
|
||||||
const tools = require('../tools/general');
|
const tools = require('../tools/general');
|
||||||
|
|
||||||
const {ObjectID} = require('mongodb');
|
const { ObjectID } = require('mongodb');
|
||||||
|
|
||||||
const {Movement} = require('../models/movement');
|
const { Movement } = require('../models/movement');
|
||||||
const {Account} = require('../models/account');
|
const { Account } = require('../models/account');
|
||||||
|
|
||||||
const i18n = require('i18n');
|
const i18n = require('i18n');
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ mongoose.plugin(schema => {
|
|||||||
const CircuitSchema = new Schema({
|
const CircuitSchema = new Schema({
|
||||||
_id: {
|
_id: {
|
||||||
type: String,
|
type: String,
|
||||||
default: function() {
|
default: function () {
|
||||||
return new ObjectID().toString();
|
return new ObjectID().toString();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -145,8 +145,8 @@ const CircuitSchema = new Schema({
|
|||||||
},
|
},
|
||||||
admins: [
|
admins: [
|
||||||
{
|
{
|
||||||
username: {type: String},
|
username: { type: String },
|
||||||
date: {type: Date},
|
date: { type: Date },
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
photos: [
|
photos: [
|
||||||
@@ -164,14 +164,14 @@ const CircuitSchema = new Schema({
|
|||||||
req_users: [
|
req_users: [
|
||||||
{
|
{
|
||||||
_id: false,
|
_id: false,
|
||||||
username: {type: String},
|
username: { type: String },
|
||||||
date: {type: Date},
|
date: { type: Date },
|
||||||
}], // username
|
}], // username
|
||||||
refused_users: [
|
refused_users: [
|
||||||
{
|
{
|
||||||
_id: false,
|
_id: false,
|
||||||
username: {type: String},
|
username: { type: String },
|
||||||
date: {type: Date},
|
date: { type: Date },
|
||||||
}], // username
|
}], // username
|
||||||
deleted: {
|
deleted: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -190,7 +190,7 @@ const CircuitSchema = new Schema({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
CircuitSchema.pre('save', async function(next) {
|
CircuitSchema.pre('save', async function (next) {
|
||||||
if (this.isNew) {
|
if (this.isNew) {
|
||||||
this._id = new ObjectID().toString();
|
this._id = new ObjectID().toString();
|
||||||
|
|
||||||
@@ -200,10 +200,10 @@ CircuitSchema.pre('save', async function(next) {
|
|||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
CircuitSchema.statics.findAllIdApp = async function(idapp) {
|
CircuitSchema.statics.findAllIdApp = async function (idapp) {
|
||||||
const Circuit = this;
|
const Circuit = this;
|
||||||
|
|
||||||
const myfind = {idapp, deleted: false};
|
const myfind = { idapp, deleted: false };
|
||||||
|
|
||||||
const whatToShow = this.getWhatToShow(idapp, '');
|
const whatToShow = this.getWhatToShow(idapp, '');
|
||||||
|
|
||||||
@@ -212,21 +212,21 @@ CircuitSchema.statics.findAllIdApp = async function(idapp) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.getFieldsForSearch = function() {
|
CircuitSchema.statics.getFieldsForSearch = function () {
|
||||||
return [
|
return [
|
||||||
{field: 'nome_circuito', type: tools.FieldType.string},
|
{ field: 'nome_circuito', type: tools.FieldType.string },
|
||||||
{field: 'sotto_nome', type: tools.FieldType.string},
|
{ field: 'sotto_nome', type: tools.FieldType.string },
|
||||||
{field: 'nome_valuta', type: tools.FieldType.string},
|
{ field: 'nome_valuta', type: tools.FieldType.string },
|
||||||
{field: 'descr', type: tools.FieldType.string},
|
{ field: 'descr', type: tools.FieldType.string },
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.executeQueryTable = function(idapp, params, user) {
|
CircuitSchema.statics.executeQueryTable = function (idapp, params, user) {
|
||||||
params.fieldsearch = this.getFieldsForSearch();
|
params.fieldsearch = this.getFieldsForSearch();
|
||||||
return tools.executeQueryTable(this, idapp, params, user);
|
return tools.executeQueryTable(this, idapp, params, user);
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.getWhatToShow = function(idapp, username) {
|
CircuitSchema.statics.getWhatToShow = function (idapp, username) {
|
||||||
// FOR ME, PERMIT ALL
|
// FOR ME, PERMIT ALL
|
||||||
return {
|
return {
|
||||||
_id: 1,
|
_id: 1,
|
||||||
@@ -267,29 +267,29 @@ CircuitSchema.statics.getWhatToShow = function(idapp, username) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Aggiungi agli Admin del Circuito
|
// Aggiungi agli Admin del Circuito
|
||||||
CircuitSchema.statics.addToAdminOfMyCircuit = async function(idapp, username, name) {
|
CircuitSchema.statics.addToAdminOfMyCircuit = async function (idapp, username, name) {
|
||||||
|
|
||||||
return await Circuit.updateOne({idapp, name},
|
return await Circuit.updateOne({ idapp, name },
|
||||||
|
{
|
||||||
|
$push:
|
||||||
{
|
{
|
||||||
$push:
|
admins: {
|
||||||
{
|
username,
|
||||||
admins: {
|
date: new Date(),
|
||||||
username,
|
},
|
||||||
date: new Date(),
|
},
|
||||||
},
|
});
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Rimuovi dagli Admin del Circuito
|
// Rimuovi dagli Admin del Circuito
|
||||||
CircuitSchema.statics.removeAdminOfMyCircuit = async function(idapp, username, name) {
|
CircuitSchema.statics.removeAdminOfMyCircuit = async function (idapp, username, name) {
|
||||||
|
|
||||||
return await Circuit.updateOne({idapp, name},
|
return await Circuit.updateOne({ idapp, name },
|
||||||
{$pull: {admins: {username: {$in: [username]}}}});
|
{ $pull: { admins: { username: { $in: [username] } } } });
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.getWhatToShow_Unknown = function(idapp, username) {
|
CircuitSchema.statics.getWhatToShow_Unknown = function (idapp, username) {
|
||||||
return {
|
return {
|
||||||
groupnameId: 1,
|
groupnameId: 1,
|
||||||
path: 1,
|
path: 1,
|
||||||
@@ -326,11 +326,11 @@ CircuitSchema.statics.getWhatToShow_Unknown = function(idapp, username) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.getCircuitsByUsername = async function(idapp, username, user) {
|
CircuitSchema.statics.getCircuitsByUsername = async function (idapp, username, user) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const {User} = require('../models/user');
|
const { User } = require('../models/user');
|
||||||
const {Account} = require('../models/account');
|
const { Account } = require('../models/account');
|
||||||
|
|
||||||
const whatToShow = this.getWhatToShow(idapp, username);
|
const whatToShow = this.getWhatToShow(idapp, username);
|
||||||
const whatToShow_Unknown = this.getWhatToShow_Unknown(idapp, username);
|
const whatToShow_Unknown = this.getWhatToShow_Unknown(idapp, username);
|
||||||
@@ -340,38 +340,38 @@ CircuitSchema.statics.getCircuitsByUsername = async function(idapp, username, us
|
|||||||
const manage_mycircuits = await Circuit.find({
|
const manage_mycircuits = await Circuit.find({
|
||||||
idapp,
|
idapp,
|
||||||
'admins': {
|
'admins': {
|
||||||
$elemMatch: {username: {$eq: username}},
|
$elemMatch: { username: { $eq: username } },
|
||||||
},
|
},
|
||||||
$or: [
|
$or: [
|
||||||
{deleted: {$exists: false}},
|
{ deleted: { $exists: false } },
|
||||||
{deleted: {$exists: true, $eq: false}}],
|
{ deleted: { $exists: true, $eq: false } }],
|
||||||
}).lean();
|
}).lean();
|
||||||
|
|
||||||
let listcircuits = await Circuit.find({
|
let listcircuits = await Circuit.find({
|
||||||
idapp,
|
idapp,
|
||||||
$or: [
|
$or: [
|
||||||
{deleted: {$exists: false}},
|
{ deleted: { $exists: false } },
|
||||||
{deleted: {$exists: true, $eq: false}}],
|
{ deleted: { $exists: true, $eq: false } }],
|
||||||
}, whatToShow_Unknown).lean();
|
}, whatToShow_Unknown).lean();
|
||||||
|
|
||||||
let asked_circuits = await Circuit.find({
|
let asked_circuits = await Circuit.find({
|
||||||
idapp,
|
idapp,
|
||||||
'req_users': {
|
'req_users': {
|
||||||
$elemMatch: {username: {$eq: username}},
|
$elemMatch: { username: { $eq: username } },
|
||||||
},
|
},
|
||||||
$or: [
|
$or: [
|
||||||
{deleted: {$exists: false}},
|
{ deleted: { $exists: false } },
|
||||||
{deleted: {$exists: true, $eq: false}}],
|
{ deleted: { $exists: true, $eq: false } }],
|
||||||
}, whatToShow_Unknown).lean();
|
}, whatToShow_Unknown).lean();
|
||||||
|
|
||||||
let refused_circuits = await Circuit.find({
|
let refused_circuits = await Circuit.find({
|
||||||
idapp,
|
idapp,
|
||||||
'refused_users': {
|
'refused_users': {
|
||||||
$elemMatch: {username: {$eq: username}},
|
$elemMatch: { username: { $eq: username } },
|
||||||
},
|
},
|
||||||
$or: [
|
$or: [
|
||||||
{deleted: {$exists: false}},
|
{ deleted: { $exists: false } },
|
||||||
{deleted: {$exists: true, $eq: false}}],
|
{ deleted: { $exists: true, $eq: false } }],
|
||||||
}, whatToShow_Unknown).lean();
|
}, whatToShow_Unknown).lean();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -396,7 +396,7 @@ CircuitSchema.statics.getCircuitsByUsername = async function(idapp, username, us
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.getInfoCircuitByName = async function(idapp, name) {
|
CircuitSchema.statics.getInfoCircuitByName = async function (idapp, name) {
|
||||||
|
|
||||||
const whatToShow = this.getWhatToShow(idapp, '');
|
const whatToShow = this.getWhatToShow(idapp, '');
|
||||||
|
|
||||||
@@ -414,7 +414,7 @@ CircuitSchema.statics.getInfoCircuitByName = async function(idapp, name) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.getCircuitByName = async function(idapp, name) {
|
CircuitSchema.statics.getCircuitByName = async function (idapp, name) {
|
||||||
|
|
||||||
const myfind = {
|
const myfind = {
|
||||||
idapp,
|
idapp,
|
||||||
@@ -430,7 +430,7 @@ CircuitSchema.statics.getCircuitByName = async function(idapp, name) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.getCircuitById = async function(circuitId) {
|
CircuitSchema.statics.getCircuitById = async function (circuitId) {
|
||||||
|
|
||||||
const myfind = {
|
const myfind = {
|
||||||
_id: circuitId,
|
_id: circuitId,
|
||||||
@@ -445,12 +445,12 @@ CircuitSchema.statics.getCircuitById = async function(circuitId) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.deleteCircuit = async function(idapp, usernameOrig, name) {
|
CircuitSchema.statics.deleteCircuit = async function (idapp, usernameOrig, name) {
|
||||||
console.log('Circuito ' + name + ' rimosso da ' + usernameOrig);
|
console.log('Circuito ' + name + ' rimosso da ' + usernameOrig);
|
||||||
return await Circuit.findOneAndRemove({idapp, name});
|
return await Circuit.findOneAndRemove({ idapp, name });
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.getUserCircuits = async function(idapp, username) {
|
CircuitSchema.statics.getUserCircuits = async function (idapp, username) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let aggr1 = [
|
let aggr1 = [
|
||||||
@@ -458,8 +458,8 @@ CircuitSchema.statics.getUserCircuits = async function(idapp, username) {
|
|||||||
$match: {
|
$match: {
|
||||||
idapp, username,
|
idapp, username,
|
||||||
$or: [
|
$or: [
|
||||||
{deleted: {$exists: false}},
|
{ deleted: { $exists: false } },
|
||||||
{deleted: {$exists: true, $eq: false}}],
|
{ deleted: { $exists: true, $eq: false } }],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -504,9 +504,9 @@ CircuitSchema.statics.getUserCircuits = async function(idapp, username) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.getUsersSingleCircuit = async function(idapp, username, circuitname, circuitId) {
|
CircuitSchema.statics.getUsersSingleCircuit = async function (idapp, username, circuitname, circuitId) {
|
||||||
|
|
||||||
const {User} = require('../models/user');
|
const { User } = require('../models/user');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let aggr1 = [
|
let aggr1 = [
|
||||||
@@ -514,7 +514,7 @@ CircuitSchema.statics.getUsersSingleCircuit = async function(idapp, username, ci
|
|||||||
$match: {
|
$match: {
|
||||||
idapp: idapp,
|
idapp: idapp,
|
||||||
'profile.mycircuits': {
|
'profile.mycircuits': {
|
||||||
$elemMatch: {circuitname: {$eq: circuitname}},
|
$elemMatch: { circuitname: { $eq: circuitname } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -546,33 +546,38 @@ CircuitSchema.statics.getUsersSingleCircuit = async function(idapp, username, ci
|
|||||||
{$unwind: '$circuit'},
|
{$unwind: '$circuit'},
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
$project: {username: 1, profile: 1, idapp: 1 /*, 'circuit.name': 1, 'circuit._id': 1*/},
|
$project: {
|
||||||
|
username: 1,
|
||||||
|
name: 1,
|
||||||
|
surname: 1,
|
||||||
|
profile: 1, idapp: 1 /*, 'circuit.name': 1, 'circuit._id': 1*/
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
$lookup: {
|
$lookup: {
|
||||||
from: 'accounts',
|
from: 'accounts',
|
||||||
as: 'account',
|
as: 'account',
|
||||||
let: {username: '$username', idapp: '$idapp', circuitId: circuitId /*, circuitId: '$circuit._id' */ },
|
let: { username: '$username', idapp: '$idapp', circuitId: circuitId /*, circuitId: '$circuit._id' */ },
|
||||||
pipeline: [
|
pipeline: [
|
||||||
{
|
{
|
||||||
$match:
|
$match:
|
||||||
{
|
{
|
||||||
$expr:
|
$expr:
|
||||||
{
|
{
|
||||||
$and:
|
$and:
|
||||||
[
|
[
|
||||||
{$eq: ['$$username', '$username']},
|
{ $eq: ['$$username', '$username'] },
|
||||||
{$eq: ['$$idapp', '$idapp']},
|
{ $eq: ['$$idapp', '$idapp'] },
|
||||||
{$eq: ['$$circuitId', '$circuitId']},
|
{ $eq: ['$$circuitId', '$circuitId'] },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{$unwind: '$account'},
|
{ $unwind: '$account' },
|
||||||
];
|
];
|
||||||
|
|
||||||
ris = await User.aggregate(aggr1);
|
ris = await User.aggregate(aggr1);
|
||||||
@@ -584,7 +589,7 @@ CircuitSchema.statics.getUsersSingleCircuit = async function(idapp, username, ci
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.getCircolanteSingolaTransaz = function(accountorigTable, accountdestTable) {
|
CircuitSchema.statics.getCircolanteSingolaTransaz = function (accountorigTable, accountdestTable) {
|
||||||
|
|
||||||
let circolante = 0;
|
let circolante = 0;
|
||||||
if (accountdestTable.saldo > 0)
|
if (accountdestTable.saldo > 0)
|
||||||
@@ -595,7 +600,7 @@ CircuitSchema.statics.getCircolanteSingolaTransaz = function(accountorigTable, a
|
|||||||
return circolante;
|
return circolante;
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.sendCoins = async function(onlycheck, idapp, usernameOrig, extrarec) {
|
CircuitSchema.statics.sendCoins = async function (onlycheck, idapp, usernameOrig, extrarec) {
|
||||||
|
|
||||||
let ris = {
|
let ris = {
|
||||||
result: false,
|
result: false,
|
||||||
@@ -650,7 +655,7 @@ CircuitSchema.statics.sendCoins = async function(onlycheck, idapp, usernameOrig,
|
|||||||
totTransato: circuittable.totTransato,
|
totTransato: circuittable.totTransato,
|
||||||
totCircolante: circuittable.totCircolante,
|
totCircolante: circuittable.totCircolante,
|
||||||
};
|
};
|
||||||
await Circuit.updateOne({_id: circuittable}, {$set: paramstoupdate});
|
await Circuit.updateOne({ _id: circuittable }, { $set: paramstoupdate });
|
||||||
|
|
||||||
ris.result = true;
|
ris.result = true;
|
||||||
console.log('Inviate Monete da', usernameOrig, extrarec.dest, myqty, extrarec.causal);
|
console.log('Inviate Monete da', usernameOrig, extrarec.dest, myqty, extrarec.causal);
|
||||||
@@ -677,45 +682,45 @@ CircuitSchema.statics.sendCoins = async function(onlycheck, idapp, usernameOrig,
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Rimuovo la Richiesta del Circuito
|
// Rimuovo la Richiesta del Circuito
|
||||||
CircuitSchema.statics.removeReqCircuit = async function(idapp, username, name) {
|
CircuitSchema.statics.removeReqCircuit = async function (idapp, username, name) {
|
||||||
|
|
||||||
return await Circuit.updateOne({idapp, name},
|
return await Circuit.updateOne({ idapp, name },
|
||||||
{$pull: {req_users: {username: {$in: [username]}}}});
|
{ $pull: { req_users: { username: { $in: [username] } } } });
|
||||||
};
|
};
|
||||||
|
|
||||||
// Aggiungi agli utenti Rifiutati del Circuito
|
// Aggiungi agli utenti Rifiutati del Circuito
|
||||||
|
|
||||||
CircuitSchema.statics.refuseReqCircuit = async function(idapp, username, name) {
|
CircuitSchema.statics.refuseReqCircuit = async function (idapp, username, name) {
|
||||||
|
|
||||||
return await Circuit.updateOne({idapp, name},
|
return await Circuit.updateOne({ idapp, name },
|
||||||
|
{
|
||||||
|
$push:
|
||||||
{
|
{
|
||||||
$push:
|
refused_users: {
|
||||||
{
|
username,
|
||||||
refused_users: {
|
date: new Date(),
|
||||||
username,
|
},
|
||||||
date: new Date(),
|
},
|
||||||
},
|
});
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.updateData = async function(idapp, circuitname) {
|
CircuitSchema.statics.updateData = async function (idapp, circuitname) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const {User} = require('./user');
|
const { User } = require('./user');
|
||||||
|
|
||||||
let aggr1 = [
|
let aggr1 = [
|
||||||
{
|
{
|
||||||
$match: {
|
$match: {
|
||||||
idapp,
|
idapp,
|
||||||
'profile.mycircuits': {
|
'profile.mycircuits': {
|
||||||
$elemMatch: {circuitname: {$eq: circuitname}},
|
$elemMatch: { circuitname: { $eq: circuitname } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{$group: {_id: null, count: {$sum: 1}}},
|
{ $group: { _id: null, count: { $sum: 1 } } },
|
||||||
];
|
];
|
||||||
|
|
||||||
const ris = await User.aggregate(aggr1);
|
const ris = await User.aggregate(aggr1);
|
||||||
@@ -725,7 +730,7 @@ CircuitSchema.statics.updateData = async function(idapp, circuitname) {
|
|||||||
let paramstoupdate = {
|
let paramstoupdate = {
|
||||||
numMembers: numMembers,
|
numMembers: numMembers,
|
||||||
};
|
};
|
||||||
const risult = await this.updateOne({idapp, name: circuitname}, {$set: paramstoupdate});
|
const risult = await this.updateOne({ idapp, name: circuitname }, { $set: paramstoupdate });
|
||||||
|
|
||||||
console.log('risult', risult);
|
console.log('risult', risult);
|
||||||
|
|
||||||
@@ -735,13 +740,13 @@ CircuitSchema.statics.updateData = async function(idapp, circuitname) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CircuitSchema.statics.setDeperimentoOff = async function() {
|
CircuitSchema.statics.setDeperimentoOff = async function () {
|
||||||
|
|
||||||
return await Circuit.updateMany({}, {$set: {'deperimento': false}},
|
return await Circuit.updateMany({}, { $set: { 'deperimento': false } },
|
||||||
{new: false});
|
{ new: false });
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const Circuit = mongoose.model('Circuit', CircuitSchema);
|
const Circuit = mongoose.model('Circuit', CircuitSchema);
|
||||||
|
|
||||||
module.exports = {Circuit};
|
module.exports = { Circuit };
|
||||||
|
|||||||
@@ -3133,11 +3133,22 @@ UserSchema.statics.getFieldsForSearch = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.getFieldsForSearchUserFriend = function () {
|
UserSchema.statics.getFieldsForSearchUserFriend = function () {
|
||||||
return [{ field: 'username', type: tools.FieldType.exact }];
|
return [
|
||||||
|
{ field: 'username', type: tools.FieldType.exact },
|
||||||
|
{ field: 'profile.username_telegram', type: tools.FieldType.string },
|
||||||
|
{ field: 'name', type: tools.FieldType.string },
|
||||||
|
{ field: 'surname', type: tools.FieldType.string },
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.getFieldsForSearchUserFriend_AllWords = function () {
|
UserSchema.statics.getFieldsForSearchUserFriend_AllWords = function () {
|
||||||
return [{ field: 'username', type: tools.FieldType.string }];
|
return [
|
||||||
|
{ field: 'username', type: tools.FieldType.string },
|
||||||
|
{ field: 'profile.username_telegram', type: tools.FieldType.string },
|
||||||
|
{ field: 'name', type: tools.FieldType.string },
|
||||||
|
{ field: 'surname', type: tools.FieldType.string },
|
||||||
|
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.executeQueryTable = function (idapp, params) {
|
UserSchema.statics.executeQueryTable = function (idapp, params) {
|
||||||
|
|||||||
@@ -614,6 +614,8 @@ router.post('/getexp', authenticate, (req, res) => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
username: 1,
|
username: 1,
|
||||||
|
name: 1,
|
||||||
|
surname: 1,
|
||||||
email: 1,
|
email: 1,
|
||||||
'reported': 1,
|
'reported': 1,
|
||||||
date_report: 1,
|
date_report: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user