|
@@ -29,11 +29,16 @@ class TeamApplyService extends CrudService {
|
|
|
});
|
|
|
if (list.length > 0) {
|
|
|
list = JSON.parse(JSON.stringify(list));
|
|
|
- list = list.map(i => {
|
|
|
+ const arr = [];
|
|
|
+ for (const i of list) {
|
|
|
+ const { user_id } = i;
|
|
|
+ const num = await this.model.count({ $or: [{ one_member_id: user_id }, { two_member_id: user_id }] });
|
|
|
+ if (num > 0) continue;
|
|
|
i.user_name = _.get(i, 'user_id.user_id.name');
|
|
|
i.user_id = _.get(i, 'user_id._id');
|
|
|
- return i;
|
|
|
- });
|
|
|
+ arr.push(i);
|
|
|
+ }
|
|
|
+ list = arr;
|
|
|
}
|
|
|
|
|
|
return list;
|