🐞 fix(gvg): 修复农田特殊种子加成逻辑
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user