I do not understand.
distribute money along all the users ? HOW ? on a MLM
Hi, I am creating an MLM multilevel market, am on my way of trying to pay all the people that are on the upper levels, but I want to ask first how would you manage it... so, there comes in 100 dollars, the 40% in this case 40 dollars most travel along with all the upper affiliates levels and distribute the money that way, so if there are 40 upper levels to each one The system most assign 1 dollar, but how to make this work... how to calculate all these tasks... because in the future there will be like 2.000.000.000 on each transaction waiting to be paid... how can this be managed without overhead the system or making a WHILE loop, I want the server make and event or make a list of task that he will be delivering the money to each account but when he got time to do it... got me?
I have the relationship for now of a subscribed user and his sponsor so I got like USER 2 is sponsor by USER 1 if user 2 affiliate someone the will be like USER 8 sponsor by USER 2 on a table record of sponsors, thanks in advance if someone can point me in the right direction.
Sponsor::where(function ($query) use ($id) {
$query->where('root_affiliate_id', $id)
->orWhere('parent_affiliate_id', $id);
})
->each
->increment($amount);
And you figure out amount based on what is the total and divide it by the number of sponsors that match that query.
Please or to participate in this conversation.