This commit is contained in:
aozhiwei 2024-10-10 19:10:48 +08:00
parent eb025631a7
commit 780b765c2a

View File

@ -129,6 +129,24 @@ class HashRate extends BaseModel
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){
$row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(),