This commit is contained in:
aozhiwei 2023-08-25 19:23:05 +08:00
parent e411f4a2eb
commit bb0656a293

View File

@ -170,13 +170,42 @@ class Staking extends BaseModel {
if (!$stakingMeta) { if (!$stakingMeta) {
return false; return false;
} }
$stakingValue = $stakingMeta['stake_value'];
$realValue = $stakingValue / self::getCecPrice();
if ($row['stake_time'] >= 3600 * 24 * 30 * 12 * 2) { if ($row['stake_time'] >= 3600 * 24 * 30 * 12 * 2) {
} else if ($row['stake_time'] <= 3600 * 24 * 30 * 1) { } else if ($row['stake_time'] <= 3600 * 24 * 30 * 12 * 1) {
} else { } else {
return false; return false;
} }
return true; return true;
} }
public static function getCecPrice()
{
return 1;
}
public static function getDailyInterest($stakeTime)
{
$months = intval($stakeTime / 3600 / 24 / 30);
if ($months <= 0) {
return 0;
}
//1 3 6 12 24
if ($months <= 1) {
return 0.01 / 30 * $months;
} else if ($months <= 3) {
return 0.05 / 30 * $months;
} else if ($months <= 6) {
return 0.15 / 30 * $months;
} else if ($months <= 12) {
return 0.4 / 30 * $months;
} else if ($months <= 24) {
return 1 / 30 * $months;
} else {
return 0;
}
}
} }