MLM Organization Grading Marketing Program. Enter the investment amount, the return rate (between 8% and 18%), the investment month, automatically calculates the money that each level should receive. The first level of the rule of the person to take the yield, the second level of personnel to take a Commission (Commission coefficient of 50,000 or less 1.3%, 200,000 or less 1.4%, 500,000 or less 1.55%, 800,000 or less 1.7%, 1 million or more 1.8%). The bonus sum for the remaining grading staff is the Commission for the second tier, but the bonus factor ratio is 0.5%.
Don't understand, ask for help, thank you.
Reply to discussion (solution)
/**
* @param $fee Investment Amount
* @param $yield Rate of return
* @return Array of available money for each level: array (' Levels ' + ',...)
*/
public static function distribution ($fee, $yield)
{
$money = Array ();
$total = 10; Minimum distribution level: how many distribution levels are in total
$money [1] = $fee * $yield;
if ($fee < 50000)
{
$royalty = 1.3; Percent Sign
}
ElseIf ($fee < 200000)
{
$royalty = 1.4;
}
ElseIf ($fee < 500000)
{
$royalty = 1.55;
}
ElseIf ($fee < 800000)
{
$royalty = 1.7;
}
ElseIf ($fee < 1000000)
{
$royalty = 1.8;
}
Else
{
$royalty = 2;
}
$money [2] = ($fee * $royalty)/100;
$sum = $money [2];
$money [3] = $sum * 0.005/(1-(1-0.005) ^ $total); Equal To sum
$base = $money [3];
for ($level = 4; $level <= $total; $level + +)
{
$money [$level] = $base * (1-0.005);
}
return $money;
}
You see, right?
It's not clear that PHP supports multiple parties
It's not clear that PHP supports multiple parties
Support