1
This commit is contained in:
parent
e411f4a2eb
commit
bb0656a293
@ -170,13 +170,42 @@ class Staking extends BaseModel {
|
||||
if (!$stakingMeta) {
|
||||
return false;
|
||||
}
|
||||
$stakingValue = $stakingMeta['stake_value'];
|
||||
$realValue = $stakingValue / self::getCecPrice();
|
||||
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 {
|
||||
return false;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user