Yuehua has an e-commerce platform, and the calculation formula of Yue payment

Please download the Yuehua Yueyou app first, then register and fill in the recommendation code: 1745345

 

According to the calculation of the system, simulate the php simulation income and time

Wyatt Payment Calculation Rules

 

<?php
// Yue payment, calculation
/**
 * User: grace
 * Date: 18-3-14
 * Time: 9:46 am
 *Basic rules, shopping reward points, the platform intercepts 16% of the merchant's principal and returns 16% of the points, and at the same time as a consumer, the consumption returns 100% of the points
 * Drainage mode
 * Operate points as consumers and merchants at the same time
 * Consumers looking for a certain amount of small tickets, the amount is A, and the amount of RMB spent on drainage, 0.16*A, can be exchanged for the number of frozen points of A+0.16*A. The number of frozen points can be returned according to the ratio of 1/1000 per day. integral
 * The active points can be reflected to the bank card according to the deduction of 10% of the handling fee, which is your own income
 * Recommended code: 1745345
 */

$total_money = 1000;//Total investment money
echo 'total money cost ' . $total_money . "\n";
$points = round(($total_money + $total_money / 0.16), 2);
$temp_points = $points;
echo 'total points ' . $points . "\n";

//Calculate the payback time
$day = 1;
$back_money = 0;
$back_points = $points;
do {
    $back_points = round(($back_points - $back_points / 1000), 2);
    $back_money += $back_points / 1000;
//    echo '---' . $back_money . '---' . "\n";
    $day++;
} while (bccomp($total_money * 1.1, $back_money) > 0);

echo "**********Back money*****************************\n" . 'back money ' . $total_money . "\n";
echo 'need days ' . $day . "\n";
echo 'need month ' . round(($day / 30), 2) . "\n";
echo 'need year ' . round(($day / 365), 2) . "\n";


//calculate return time
echo "*********Return time******************************\n";
$income_day = 1;
do {
    $temp_points = round(($temp_points - $temp_points / 1000), 2);
    $back_money += $temp_points / 1000;
//    echo '---' . $back_money . '---' . "\n";
    $income_day++;
} while ($temp_points > 5);

echo 'left points ' . $temp_points . "\n";
echo 'total income ' . ($back_money - $total_money * 1.1) . "\n";
echo 'total income money need days ' . $income_day . "\n";
echo 'income need month ' . round(($income_day / 30), 2) . "\n";
echo 'income need year ' . round(($income_day / 365), 2) . "\n";


// Calculate how much money can be made in one year
echo "***************N year X income************************\n";
$days = 365;//The default one year time, 365 days,
$days_points = $points;
$income_money = 0;
$days_num = $days;
do {
    $days_points = round(($days_points - $days_points / 1000), 2);
    $income_money += $days_points / 1000;
//    echo '---' . $back_money . '---' . "\n";
    $days_num--;
} while ($days_num > 0);

echo 'total days  ' . $days . "\n";
echo 'total return money ' . round($income_money, 2) . "\n";
$income_money = round($income_money * 0.9, 2);
echo 'total return money after 10% fee ' . $income_money . "\n";
echo 'total income ' . ($income_money - $total_money) . "\n";
the;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324398522&siteId=291194637