Please help calculate, thank you!

Source: Internet
Author: User
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
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.