Home > Article > Backend Development > How can I convert this into code?
For example, the amount of 100 yuan should be divided equally among many people, 15% for the upper level, 20% for the upper level, 20%, 15% for the upper level, 15%, 5% for the upper level, 5%
For example, the amount of 100 yuan should be divided equally among many people, 15% for the upper level, 20% for the upper level, 20%, 15% for the upper level, 15%, 5% for the upper level, 5%
That’s what I thought
Company ID, company name, parent company ID This is similar to a tree menu
For example, company ID = 15, company name = 3D Code Technology, parent company ID = 17
First write an algorithm and search up level by level to form a tree menu. At the top, parent ID = 0
In this way, the income can be distributed.
You want code + table design! I still want ideas!
Table design depends on infinite classification
The code logic is based on level one, level two, and level three. . . . . The percentage of categories