From 7b756051a9e557de2173007a41652c9add09e132 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Fri, 2 Aug 2024 15:26:16 +0800 Subject: [PATCH] 1 --- doc/HashRate.py | 2 ++ webapp/controller/HashRateController.class.php | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/doc/HashRate.py b/doc/HashRate.py index 6c857da1..06d8e435 100644 --- a/doc/HashRate.py +++ b/doc/HashRate.py @@ -19,9 +19,11 @@ class HashRate(object): ['!task_list2', [HashRateList()], '任务列表2'], ['obtain_start_time', 0, '获得期开始时间'], ['obtain_end_time', 0, '获得期结束时间'], + ['income_start_time', 0, '盈利期开始时间'], ['income_end_time', 0, '盈利期结束时间'], ['state', 0, '0:未开始 1:获得期 2:盈利期'], ['myHashRate', 0, '我的算力'], + ['goldRate', 0, '金币加成'], ['refresh_times', 0, '今日刷新次数'], ] },{ diff --git a/webapp/controller/HashRateController.class.php b/webapp/controller/HashRateController.class.php index 7a7d50aa..d7f1f6b0 100644 --- a/webapp/controller/HashRateController.class.php +++ b/webapp/controller/HashRateController.class.php @@ -29,6 +29,7 @@ class HashRateController extends BaseAuthedController $income_end_time = 0; $state = 0; $myHashRate = 0; + $goldRate = 0; $currentPeriod= \mt\AchievementsCycle::getCurrentPeriod(); if ($currentPeriod){ $mateList = \mt\AchievementsPower::getCustomTypeMetaList($type,$this->hashRateService); @@ -53,6 +54,16 @@ class HashRateController extends BaseAuthedController $state = 2; } $myHashRate = HashRate::getMyHashRate( $currentPeriod['id']); + $currentCompute = HashRate::getMyHashRate(); + $computeR = explode("|",mt\Parameter::getVal('economy_account_compute_R',0)); + $k = 0; + for ($i=0;$i= $computeR[$i]){ + $k = $i; + } + } + $computeE = explode("|",mt\Parameter::getVal('economy_account_compute_E',0)); + $goldRate = $computeE[$k]; } $this->_rspData(array( 'task_list1' => $taskDtoList1, @@ -64,6 +75,7 @@ class HashRateController extends BaseAuthedController 'state' => $state, 'refresh_times' => myself()->_getDailyV(TN_HASH_DAILY_REFRESH_TIMES,0), 'myHashRate' => $myHashRate, + 'goldRate' => $goldRate, )); }