From dedfaacc2de30c98580d73c8d0a0a0eca2a916e1 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 6 Aug 2024 15:33:34 +0800 Subject: [PATCH] 1 --- .../controller/HashRateController.class.php | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/webapp/controller/HashRateController.class.php b/webapp/controller/HashRateController.class.php index efcc7eeb..4d58df40 100644 --- a/webapp/controller/HashRateController.class.php +++ b/webapp/controller/HashRateController.class.php @@ -93,15 +93,28 @@ class HashRateController extends BaseAuthedController $this->_rspErr(1, 'task_id error'); return; } - $taskList = $this->hashRateService->getHashRateTasks($taskMeta['task_type']); - $taskDto = null; - foreach ($taskList as $task){ - if ($task['task_id'] == $taskId){ - $taskDb = HashRate::find($taskMeta['id'],$currentPeriod['id']); - $taskDto = $this->hashRateService->hashRateTaskDto($task,$taskDb,$currentPeriod['id']); + + if ($taskMeta['task_type'] == \mt\AchievementsPower::TYPE5){ + $task = array( + 'task_id' => $taskMeta['id'], + 'current' => 0, + ); + }else{ + $taskList = $this->hashRateService->getHashRateTasks($taskMeta['task_type']); + foreach ($taskList as $value){ + if ($value['task_id'] == $taskId){ + $task = $value; + } } } + if (!isset($task)){ + $this->_rspErr(10, 'server internal error'); + return; + } + $taskDb = HashRate::find($taskMeta['id'],$currentPeriod['id']); + $taskDto = $this->hashRateService->hashRateTaskDto($task,$taskDb,$currentPeriod['id']); + if (!$taskDto) { $this->_rspErr(10, 'server internal error'); return;