This commit is contained in:
hujiabin 2023-09-05 18:44:10 +08:00
parent d649914ae7
commit a186e56f3e
2 changed files with 5 additions and 5 deletions

View File

@ -157,9 +157,9 @@ class ComputingPowerController extends BaseAuthedController
$this->_rspErr(1, 'There are no available crystals'); $this->_rspErr(1, 'There are no available crystals');
return ; return ;
} }
$rate = Parameter::getVal('cec_exchange_rate',10); // $rate = Parameter::getVal('cec_exchange_rate',10);
$cecVal = Staking::getStakingTotalValue(); $cecVal = Staking::getStakingTotalValue();
$crystalNum = max(0,floor($cecVal / $rate / $paramEd[0]) * $paramEd[1]); $crystalNum = max(0,floor($cecVal / $paramEd[0]) * $paramEd[1]);
} }
} }

View File

@ -82,16 +82,16 @@ class HashRateService extends BaseService
case 4 : { case 4 : {
// 质压总价值 // 质压总价值
$param = explode(':',$hashRateMeta['parameter']); $param = explode(':',$hashRateMeta['parameter']);
$rate = Parameter::getVal('cec_exchange_rate',10); // $rate = Parameter::getVal('cec_exchange_rate',10);
$cecVal = Staking::getStakingTotalValue(); $cecVal = Staking::getStakingTotalValue();
$crystalDto['total'] = array( $crystalDto['total'] = array(
'param1' => floatval($cecVal / $rate), 'param1' => floatval($cecVal ),
); );
$recordDb = CrystalRecord::getNewestRecordOne($crystalMeta['id']); $recordDb = CrystalRecord::getNewestRecordOne($crystalMeta['id']);
if ($recordDb && myself()->_getNowDaySeconds() == myself()->_getDaySeconds($recordDb['createtime'])){ if ($recordDb && myself()->_getNowDaySeconds() == myself()->_getDaySeconds($recordDb['createtime'])){
$crystalDto['pending'] = 0; $crystalDto['pending'] = 0;
}else{ }else{
$totalNum = max(0,floor($cecVal / $rate / $param[0]) * $param[1]); $totalNum = max(0,floor($cecVal / $param[0]) * $param[1]);
$crystalDto['pending'] = intval($totalNum); $crystalDto['pending'] = intval($totalNum);
} }
$crystalDto['state'] = $crystalDto['pending'] > 0 ? self::RECEIVED_STATE : self::NONE_STATE; $crystalDto['state'] = $crystalDto['pending'] > 0 ? self::RECEIVED_STATE : self::NONE_STATE;