From 2978e5093fa009872b212ffdf5597cbcf1ffdc23 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 16 Apr 2024 21:26:52 +0800 Subject: [PATCH] 1 --- webapp/services/RoomBattleDataService.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/webapp/services/RoomBattleDataService.php b/webapp/services/RoomBattleDataService.php index 9a96597b..c14f9c4d 100644 --- a/webapp/services/RoomBattleDataService.php +++ b/webapp/services/RoomBattleDataService.php @@ -183,13 +183,15 @@ class RoomBattleDataService extends BaseService { //įŽ—åŠ›åŠ æˆ $currentPeriod= \mt\AchievementsCycle::getCurrentPeriod(); - $lastCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id'] - 1); - $currentCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id']); - $s = mt\Parameter::getVal('economy_account_compute_s',0); - $totalCompute = $currentCompute + $s * $lastCompute; - $computeParam = mt\Parameter::getVal('economy_account_compute_K',0); - $computeMaxEffect = mt\Parameter::getVal('economy_account_compute_E',0); - $gold = intval( $gold * ($totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect + 1)); + if ($currentPeriod){ + $lastCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id'] - 1); + $currentCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id']); + $s = mt\Parameter::getVal('economy_account_compute_s',0); + $totalCompute = $currentCompute + $s * $lastCompute; + $computeParam = mt\Parameter::getVal('economy_account_compute_K',0); + $computeMaxEffect = mt\Parameter::getVal('economy_account_compute_E',0); + $gold = intval( $gold * ($totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect + 1)); + } if ($gold > 0){ array_push($reward,array( "item_id" => V_ITEM_GOLD,