|
@@ -11,6 +11,7 @@ class LookuserService extends CrudService {
|
|
|
constructor(ctx) {
|
|
|
super(ctx, 'lookuser');
|
|
|
this.model = this.ctx.model.Lookuser;
|
|
|
+ this.rmodel = this.ctx.model.Room;
|
|
|
}
|
|
|
|
|
|
async create(data) {
|
|
@@ -21,6 +22,18 @@ class LookuserService extends CrudService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ async looknumber() {
|
|
|
+ const rooms = await this.rmodel.find();
|
|
|
+ const data = [];
|
|
|
+ for (const _room of rooms) {
|
|
|
+ const room = _.cloneDeep(JSON.parse(JSON.stringify(_room)));
|
|
|
+ const number = await this.model.count({ roomid: room.id });
|
|
|
+ room.number = number;
|
|
|
+ data.push(room);
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
module.exports = LookuserService;
|