1
This commit is contained in:
commit
da09b0a369
@ -157,9 +157,9 @@ class ComputingPowerController extends BaseAuthedController
|
||||
$this->_rspErr(1, 'There are no available crystals');
|
||||
return ;
|
||||
}
|
||||
$rate = Parameter::getVal('cec_exchange_rate',10);
|
||||
// $rate = Parameter::getVal('cec_exchange_rate',10);
|
||||
$cecVal = Staking::getStakingTotalValue();
|
||||
$crystalNum = max(0,floor($cecVal / $rate / $paramEd[0]) * $paramEd[1]);
|
||||
$crystalNum = max(0,floor($cecVal / $paramEd[0]) * $paramEd[1]);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ class Staking extends BaseModel {
|
||||
$stakingDto = self::toDto($row);
|
||||
if ($stakingDto['status'] == self::STAKING_STATUS) {
|
||||
if ($stakingDto['remain_days'] > 0) {
|
||||
$totalValue += $stakingDto['cec_value'];
|
||||
$totalValue += $stakingDto['stake_usd_value'];
|
||||
} else {
|
||||
}
|
||||
}
|
||||
@ -235,7 +235,8 @@ class Staking extends BaseModel {
|
||||
'item_id' => $row['item_id'],
|
||||
'status' => $row['status'],
|
||||
'stacked_num' => $row['stacked_num'],
|
||||
'cec_value' => $stakingMeta['stake_value']
|
||||
'cec_value' => $stakingMeta['stake_value'],
|
||||
'stake_usd_value' => $stakingMeta['stake_usd_value'],
|
||||
);
|
||||
$passedDays = intval(((myself()->_getNowDaySeconds()) -
|
||||
(myself()->_getDaySeconds($row['start_time']) + 3600 * 24)) /
|
||||
|
@ -82,16 +82,16 @@ class HashRateService extends BaseService
|
||||
case 4 : {
|
||||
// 质压总价值
|
||||
$param = explode(':',$hashRateMeta['parameter']);
|
||||
$rate = Parameter::getVal('cec_exchange_rate',10);
|
||||
// $rate = Parameter::getVal('cec_exchange_rate',10);
|
||||
$cecVal = Staking::getStakingTotalValue();
|
||||
$crystalDto['total'] = array(
|
||||
'param1' => floatval($cecVal / $rate),
|
||||
'param1' => floatval($cecVal ),
|
||||
);
|
||||
$recordDb = CrystalRecord::getNewestRecordOne($crystalMeta['id']);
|
||||
if ($recordDb && myself()->_getNowDaySeconds() == myself()->_getDaySeconds($recordDb['createtime'])){
|
||||
$crystalDto['pending'] = 0;
|
||||
}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['state'] = $crystalDto['pending'] > 0 ? self::RECEIVED_STATE : self::NONE_STATE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user