1
This commit is contained in:
parent
eb025631a7
commit
780b765c2a
@ -129,6 +129,24 @@ class HashRate extends BaseModel
|
|||||||
return $myHashRate;
|
return $myHashRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function decMyCurrentHashRate($val){
|
||||||
|
$val = intval($val);
|
||||||
|
$currentPeriod = myself()->_callMtStatic('AchievementsCycle', 'getCurrentPeriod');
|
||||||
|
if ($currentPeriod) {
|
||||||
|
SqlHelper::update(
|
||||||
|
myself()->_getSelfMysql(),
|
||||||
|
't_hash_rate_reward',
|
||||||
|
array(
|
||||||
|
'account_id' => myself()->_getAccountId(),
|
||||||
|
'period' => $currentPeriod['id'],
|
||||||
|
'reward' => function () use($val) {
|
||||||
|
return "GREATEST(0, reward - ${val})";
|
||||||
|
},
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function getTotalByAccount($accountId,$period){
|
public static function getTotalByAccount($accountId,$period){
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getSelfMysql(),
|
myself()->_getSelfMysql(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user