🐞 fix(gvg): 修复农场帮收无收入
This commit is contained in:
@@ -294,8 +294,9 @@ export class GVGProduceHandler {
|
||||
// 活跃
|
||||
await addGVGActive(myLeague.leagueCode, targetRoleId, GVG_ACTIVE_TYPE.COST_PRODUCE_COIN, activeSum);
|
||||
|
||||
const leagueFarm = resultField.filter(cur => cur.farmId == dicFarm.id && cur.unlockTime >= nowSeconds()); // 已种植单位
|
||||
const canHarvestFarms = resultField.filter(cur => dicFarm.type == GVG_RESOURCE_TYPE.FOOD && cur.farmId == dicFarm.id && cur.harvestTime > 0 && cur.harvestTime <= nowSeconds());
|
||||
const leagueFarms = await GVGLeagueFarmModel.findByFarmId(configId, myLeague.leagueCode, farmId);
|
||||
const leagueFarm = leagueFarms.filter(cur => cur.farmId == dicFarm.id && cur.unlockTime >= nowSeconds()); // 已种植单位
|
||||
const canHarvestFarms = leagueFarms.filter(cur => dicFarm.type == GVG_RESOURCE_TYPE.FOOD && cur.farmId == dicFarm.id && cur.harvestTime > 0 && cur.harvestTime <= nowSeconds());
|
||||
let obj = new LeagueFarmListInfo(dicFarm.id, leagueFarm.length, canHarvestFarms.length > 0);
|
||||
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
|
||||
@@ -148,7 +148,7 @@ export default class GVGLeagueFarm extends BaseModel {
|
||||
const result = await GVGLeagueFarmModel.updateMany({ _id: { $in: _ids } },
|
||||
{ $set: { unlockTime: 0, harvestTime: 0, lockRoleId: '', lockRoleName: '', seedType: 0, index: 0 }}, { new: true });
|
||||
if(result.modifiedCount == 0) return [];
|
||||
return fieldResult.map(cur => ({ ...cur, unlockTime: 0, harvestTime: 0, lockRoleId: '', lockRoleName: '', seedType: 0, index: 0 }))
|
||||
return fieldResult
|
||||
}
|
||||
|
||||
public static async releaseLock(configId: number, leagueCode: string, farmId: number, roleId: string) {
|
||||
|
||||
Reference in New Issue
Block a user