好友:玩家武将详细信息

This commit is contained in:
luying
2021-02-04 13:57:58 +08:00
parent 50a472d8a5
commit aaeaf87324
21 changed files with 411 additions and 303 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import BaseModel from './BaseModel';
import { index, getModelForClass, prop, DocumentType, mongoose, Ref } from '@typegoose/typegoose';
import Role, { RoleType } from './Role';
import { genCode } from '../pubUtils/util';
import { ROLE } from '../consts';
import { ROLE_SELECT } from '../consts';
/**
* 好友系统关系表
@@ -37,7 +37,7 @@ export default class FriendApply extends BaseModel {
public static async getApplyList(roleId: string) {
const list: FriendApplyType[] = await FriendApplyModel.find({ roleId }, { _id: 0 })
// .select(select)
.populate('friend', ROLE.SHOW_FRIEND_APPLY_LIST, 'Role')
.populate('friend', ROLE_SELECT.SHOW_FRIEND_APPLY_LIST, 'Role')
.lean({ getters: true });
return list;
}
@@ -46,7 +46,7 @@ export default class FriendApply extends BaseModel {
public static async getApplyListByCode(applyCodeList: string[]) {
const list: FriendApplyType[] = await FriendApplyModel.find({ applyCode: { $in: applyCodeList } }, { _id: 0 })
// .select(select)
.populate('friend', ROLE.SHOW_FRIEND_APPLY_LIST, 'Role')
.populate('friend', ROLE_SELECT.SHOW_FRIEND_APPLY_LIST, 'Role')
.lean({ getters: true });
return list;
}