D
D
Darkhan Kamaliev2018-05-20 18:57:42
PHP
Darkhan Kamaliev, 2018-05-20 18:57:42

MLM (network marketing and all that), how best to make a "transfusion"?

Good day.
I wrote a multi-level referral system without restrictions on people, but now I need a matrix one..

matrix example
5b019a447ed09147020173.png

How to make a "transfusion" of users.
For example, a person comes in via a ref link to id-1, but he already has 3 referrals and he cannot accept more, how to assign him to the next person (the one who invited id-1) lower in the hierarchy? Provided that he has free "places".
There are a lot of if and queries to the database in my head, but from the side of load and optimization it seems to me a bad solution. The customer has plans for a load of at least 3k people or more in a marketing progression..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2018-05-20
@rim89

There are a lot of if and queries to the database in my head, but from the side of load and optimization it seems to me a bad solution.
recursion
explain to him that more people - more costs for the system

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question