Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb
This commit is contained in:
commit
db01ed0a30
@ -14,6 +14,7 @@ class HashRateService extends BaseService
|
|||||||
{
|
{
|
||||||
const NONE_STATE = 0;
|
const NONE_STATE = 0;
|
||||||
const RECEIVED_STATE = 1;
|
const RECEIVED_STATE = 1;
|
||||||
|
const EXCHANGE_RATE = 10;
|
||||||
public function getCrystalDto($crystalMeta,&$crystalDto){
|
public function getCrystalDto($crystalMeta,&$crystalDto){
|
||||||
$crystalDto = array(
|
$crystalDto = array(
|
||||||
'item_id' => $crystalMeta['id'],
|
'item_id' => $crystalMeta['id'],
|
||||||
@ -50,7 +51,7 @@ class HashRateService extends BaseService
|
|||||||
$crystalDto['total'] = array(
|
$crystalDto['total'] = array(
|
||||||
'param1' => intval($consumeCost),
|
'param1' => intval($consumeCost),
|
||||||
);
|
);
|
||||||
$totalNum = max(0,floor($consumeCost/$hashRateMeta['parameter']));
|
$totalNum = max(0,floor($consumeCost/self::EXCHANGE_RATE/$hashRateMeta['parameter']));
|
||||||
$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;
|
||||||
}
|
}
|
||||||
@ -61,7 +62,7 @@ class HashRateService extends BaseService
|
|||||||
$crystalDto['total'] = array(
|
$crystalDto['total'] = array(
|
||||||
'param1' => intval($consumeCost),
|
'param1' => intval($consumeCost),
|
||||||
);
|
);
|
||||||
$totalNum = max(0,floor($consumeCost/$hashRateMeta['parameter']));
|
$totalNum = max(0,floor($consumeCost/self::EXCHANGE_RATE/$hashRateMeta['parameter']));
|
||||||
$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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user