|
@@ -44,13 +44,23 @@ export class UserService extends BaseService<modelType> {
|
|
|
return user;
|
|
|
}
|
|
|
|
|
|
- async person() {
|
|
|
+ async person(filter) {
|
|
|
+ const { team } = filter;
|
|
|
const list = await this.model.find({ status: '1', type: '0' });
|
|
|
const result = [];
|
|
|
for (const val of list) {
|
|
|
const total = await this.TeamModel.count({ member: { $in: [val.id] } });
|
|
|
if (total === 0) result.push(val);
|
|
|
}
|
|
|
+ if (team) {
|
|
|
+ const teamInfo: any = await this.TeamModel.findById(team);
|
|
|
+ if (teamInfo.member) {
|
|
|
+ for (const val of teamInfo.member) {
|
|
|
+ const list = await this.model.findById(val);
|
|
|
+ if (list) result.push(list);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
}
|