My goal is to create a multi-level marketing system, with two teams.
Left and Right Team
I'm having trouble counting points.
My table looks like this: id_user | sponsor | leg (0 left, 1 right) | points
Remembering that the network has no limit and that the sum of points on the left, for example, includes all the points of the respective downlines.
I need help to make this point count.