This commit is contained in:
hujiabin 2024-08-02 15:26:16 +08:00
parent 42dc915959
commit 7b756051a9
2 changed files with 14 additions and 0 deletions

View File

@ -19,9 +19,11 @@ class HashRate(object):
['!task_list2', [HashRateList()], '任务列表2'], ['!task_list2', [HashRateList()], '任务列表2'],
['obtain_start_time', 0, '获得期开始时间'], ['obtain_start_time', 0, '获得期开始时间'],
['obtain_end_time', 0, '获得期结束时间'], ['obtain_end_time', 0, '获得期结束时间'],
['income_start_time', 0, '盈利期开始时间'],
['income_end_time', 0, '盈利期结束时间'], ['income_end_time', 0, '盈利期结束时间'],
['state', 0, '0:未开始 1:获得期 2:盈利期'], ['state', 0, '0:未开始 1:获得期 2:盈利期'],
['myHashRate', 0, '我的算力'], ['myHashRate', 0, '我的算力'],
['goldRate', 0, '金币加成'],
['refresh_times', 0, '今日刷新次数'], ['refresh_times', 0, '今日刷新次数'],
] ]
},{ },{

View File

@ -29,6 +29,7 @@ class HashRateController extends BaseAuthedController
$income_end_time = 0; $income_end_time = 0;
$state = 0; $state = 0;
$myHashRate = 0; $myHashRate = 0;
$goldRate = 0;
$currentPeriod= \mt\AchievementsCycle::getCurrentPeriod(); $currentPeriod= \mt\AchievementsCycle::getCurrentPeriod();
if ($currentPeriod){ if ($currentPeriod){
$mateList = \mt\AchievementsPower::getCustomTypeMetaList($type,$this->hashRateService); $mateList = \mt\AchievementsPower::getCustomTypeMetaList($type,$this->hashRateService);
@ -53,6 +54,16 @@ class HashRateController extends BaseAuthedController
$state = 2; $state = 2;
} }
$myHashRate = HashRate::getMyHashRate( $currentPeriod['id']); $myHashRate = HashRate::getMyHashRate( $currentPeriod['id']);
$currentCompute = HashRate::getMyHashRate();
$computeR = explode("|",mt\Parameter::getVal('economy_account_compute_R',0));
$k = 0;
for ($i=0;$i<count($computeR);$i++){
if ($currentCompute >= $computeR[$i]){
$k = $i;
}
}
$computeE = explode("|",mt\Parameter::getVal('economy_account_compute_E',0));
$goldRate = $computeE[$k];
} }
$this->_rspData(array( $this->_rspData(array(
'task_list1' => $taskDtoList1, 'task_list1' => $taskDtoList1,
@ -64,6 +75,7 @@ class HashRateController extends BaseAuthedController
'state' => $state, 'state' => $state,
'refresh_times' => myself()->_getDailyV(TN_HASH_DAILY_REFRESH_TIMES,0), 'refresh_times' => myself()->_getDailyV(TN_HASH_DAILY_REFRESH_TIMES,0),
'myHashRate' => $myHashRate, 'myHashRate' => $myHashRate,
'goldRate' => $goldRate,
)); ));
} }