Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb

This commit is contained in:
hujiabin 2023-08-28 12:05:00 +08:00
commit 31b87c2643
2 changed files with 16 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
require_once("mt/Stacking.php"); require_once("mt/Staking.php");
require_once("models/Nft.php"); require_once("models/Nft.php");
require_once("models/Stacking.php"); require_once("models/Stacking.php");

View File

@ -41,6 +41,21 @@ class Staking extends BaseModel {
return $result; return $result;
} }
public static function getStakingTotalValue()
{
$totalValue = 0;
$rows = self::all(myself()->_getAddress());
foreach ($rows as $row) {
$stakingDto = self::toDto($row);
if ($stakingDto['status'] == Stacking::STAKING_STATUS) {
if ($stakingDto['remain_days'] <= 0) {
$totalValue += $stakingDto['ceg_value'];
}
}
}
return $totalValue;
}
public static function staked721($data, $netId) public static function staked721($data, $netId)
{ {
foreach ($data['infos'] as $info) { foreach ($data['infos'] as $info) {