1
This commit is contained in:
parent
855c07b379
commit
5113f30ec4
@ -107,10 +107,10 @@ class ComputingPower(object):
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'exchangeUplimitNew',
|
||||
'desc': '晶体兑换上限',
|
||||
'name': 'exchangeCrystalInfo',
|
||||
'desc': '晶体兑换信息',
|
||||
'group': 'ComputingPower',
|
||||
'url': 'webapp/index.php?c=ComputingPower&a=exchangeUplimitNew',
|
||||
'url': 'webapp/index.php?c=ComputingPower&a=exchangeCrystalInfo',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
|
@ -351,7 +351,7 @@ class ComputingPowerController extends BaseAuthedController
|
||||
));
|
||||
}
|
||||
|
||||
public function exchangeUplimitNew(){
|
||||
public function exchangeCrystalInfo(){
|
||||
$hashRateService = new \services\HashRateService();
|
||||
$crystalInfo = $hashRateService->getCrystalValue();
|
||||
$this->_rspData(array(
|
||||
@ -460,8 +460,11 @@ class ComputingPowerController extends BaseAuthedController
|
||||
}
|
||||
|
||||
public function test(){
|
||||
print_r(\mt\HashRateTask::getMetaList());
|
||||
|
||||
$hashRateService = new \services\HashRateService();
|
||||
$crystalInfo = $hashRateService->getCrystalValue();
|
||||
$this->_rspData(array(
|
||||
'crystalInfo' => $crystalInfo
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,7 +12,8 @@ class CrystalRecord extends BaseModel
|
||||
myself()->_getSelfMysql(),
|
||||
't_crystal_exchange_record',
|
||||
array(
|
||||
'account_id'=>myself()->_getAccountId()
|
||||
'account_id'=>myself()->_getAccountId(),
|
||||
'item_id'=>ComputingPower::CRYSTAL_NEW,
|
||||
),
|
||||
function ($row) use($cb) {
|
||||
$cb($row);
|
||||
|
@ -167,8 +167,10 @@ class HashRateService extends BaseService
|
||||
$hashRateDb = HashRateTask::findByTaskIdOrSeason($metaTask['id'],$seasonMeta['id']);
|
||||
$userDb = myself()->_safeGetOrmUserInfo();
|
||||
$rankMeta = Rank::getRankById($userDb['rank']);
|
||||
if ($rankMeta['rank_order2'] > $hashRateDb['record_total']){
|
||||
//
|
||||
if ($hashRateDb && $rankMeta['rank_order2'] > $hashRateDb['record_total']){
|
||||
$finalVal = ($rankMeta['rank_order2'] - $hashRateDb['claim_total']) * $metaTask['reward'];
|
||||
|
||||
}
|
||||
} else {
|
||||
$hashRateDb = HashRateTask::findByTaskId($metaTask['id']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user