🐞 fix(gvg): 修复农田特殊种子加成逻辑

This commit is contained in:
luying
2023-02-17 10:58:47 +08:00
parent eb5808dfb1
commit f21fd2dfa8
7 changed files with 78 additions and 75 deletions
+4 -3
View File
@@ -3,6 +3,7 @@
import BaseModel from './BaseModel';
import { index, getModelForClass, prop, DocumentType, } from '@typegoose/typegoose';
import { GVGLeagueFarmType } from './GVGLeagueFarm';
import { GVG_RESOURCE_TYPE } from '../consts';
@index({ leagueCode: 1, configId: 1, farmId: 1, fieldId: 1 })
export default class GVGLeagueFarmRec extends BaseModel {
@@ -47,11 +48,11 @@ export default class GVGLeagueFarmRec extends BaseModel {
output: number; // 产量
@prop({ required: false })
outputStr: number; // 产量计算公式
outputStr: string; // 产量计算公式
public static async insertRecs(params: GVGLeagueFarmType[]) {
public static async insertRecs(type: GVG_RESOURCE_TYPE,params: GVGLeagueFarmType[]) {
let insertParams = params.map(field => {
return { ...field, startRoleId: field.lockRoleId, startTime: new Date() }
return { ...field, startRoleId: field.lockRoleId, startTime: new Date(), type }
})
await GVGLeagueFarmRecModel.insertMany(insertParams);
}