全局修改:topFive字段
This commit is contained in:
@@ -107,7 +107,7 @@ export default class PvpDefense extends BaseModel {
|
||||
|
||||
public static async findByScale(roleId: string, min: number, max: number) {
|
||||
const result: PvpDefenseType[] = await PvpDefenseModel.find({ roleId: { $ne: roleId }, defCe: { $lte: max, $gte: min } })
|
||||
.populate('role', 'headHid sHid topFiveCe roleId roleName lv globalCeAttr')
|
||||
.populate('role', 'headHid sHid topLineupCe roleId roleName lv globalCeAttr')
|
||||
.populate('heroes.hero')
|
||||
.sort({ updatedAt: -1 }).limit(100).lean({ getters: true });
|
||||
return result;
|
||||
@@ -151,7 +151,7 @@ export default class PvpDefense extends BaseModel {
|
||||
|
||||
public static async findByRoleIdIncludeAll(roleId: string) {
|
||||
const result: PvpDefenseType = await PvpDefenseModel.findOne({ roleId })
|
||||
.populate('role', 'headHid sHid topFiveCe roleId roleName lv globalCeAttr')
|
||||
.populate('role', 'headHid sHid topLineupCe roleId roleName lv globalCeAttr')
|
||||
.populate('heroes.hero')
|
||||
.populate('oppPlayers.oppDef', 'oppRoleId pos roleName headHid sHid rankLv title lv pLv defCe heroes').lean({ getters: true });
|
||||
return result;
|
||||
@@ -159,7 +159,7 @@ export default class PvpDefense extends BaseModel {
|
||||
|
||||
public static async findByTeamLv(min: number, max: number) {
|
||||
const result: PvpDefenseType[] = await PvpDefenseModel.find({ pLv: { $gte: min, $lte: max } })
|
||||
.populate('role', 'headHid sHid topFiveCe roleId roleName lv globalCeAttr')
|
||||
.populate('role', 'headHid sHid topLineupCe roleId roleName lv globalCeAttr')
|
||||
.populate('heroes.hero')
|
||||
.populate('oppPlayers.oppDef', 'oppRoleId pos roleName headHid sHid rankLv pLv title lv defCe heroes')
|
||||
.lean({ getters: true });
|
||||
@@ -169,7 +169,7 @@ export default class PvpDefense extends BaseModel {
|
||||
public static async updateInfoAndInclude(roleId: string, update: pvpUpdateInter) {
|
||||
delete update._id;
|
||||
let result: PvpDefenseType = await PvpDefenseModel.findOneAndUpdate({roleId}, {$set:update}, {new: true})
|
||||
.populate('role', 'headHid sHid topFiveCe roleId roleName lv')
|
||||
.populate('role', 'headHid sHid topLineupCe roleId roleName lv')
|
||||
.populate('oppPlayers.oppDef', 'oppRoleId pos roleName headHid sHid rankLv pLv title lv defCe heroes').lean({ getters: true });
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user