1
This commit is contained in:
parent
8db0c59e82
commit
14d1be9105
@ -54,23 +54,11 @@ class HashRateShop extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
$propertyChgService = new services\PropertyChgService();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
$awardService = new services\AwardService();
|
$awardService = new services\AwardService();
|
||||||
$tokenType = $goodsMeta['token_type'];
|
$price = $goodsMeta['pile_price'];
|
||||||
$price = $goodsMeta['price'];
|
|
||||||
if (!in_array(
|
|
||||||
$tokenType,
|
|
||||||
array(
|
|
||||||
mt\Shop::TOKEN_TYPE_GOLD,
|
|
||||||
mt\Shop::TOKEN_TYPE_DIAMOND
|
|
||||||
)
|
|
||||||
)) {
|
|
||||||
myself()->_rspErr(1, "token_type is unsupport, {$tokenType}");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($price < 1) {
|
if ($price < 1) {
|
||||||
myself()->_rspErr(1, "config error");
|
myself()->_rspErr(1, "config error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$costItemId = myself()->getCostItemIdByTokenType($tokenType);
|
|
||||||
$costItems = array(
|
$costItems = array(
|
||||||
array(
|
array(
|
||||||
'item_id' => $costItemId,
|
'item_id' => $costItemId,
|
||||||
|
@ -109,6 +109,26 @@ class HashRate extends BaseModel
|
|||||||
return $myHashRate;
|
return $myHashRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getMyCurrentHashRate(){
|
||||||
|
$currentPeriod = myself()->_callMtStatic('AchievementsCycle', 'getCurrentPeriod');
|
||||||
|
if (empty($currentPeriod)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
$row = SqlHelper::ormSelectOne(
|
||||||
|
myself()->_getSelfMysql(),
|
||||||
|
't_hash_rate_reward',
|
||||||
|
array(
|
||||||
|
'account_id' => myself()->_getAccountId(),
|
||||||
|
'period' => $currentPeriod['id'],
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$myHashRate = 0;
|
||||||
|
if ($row){
|
||||||
|
$myHashRate = $row['reward'];
|
||||||
|
}
|
||||||
|
return $myHashRate;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getTotalByAccount($accountId,$period){
|
public static function getTotalByAccount($accountId,$period){
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getSelfMysql(),
|
myself()->_getSelfMysql(),
|
||||||
@ -126,4 +146,4 @@ class HashRate extends BaseModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user