How to calculate TreeOrder

TreeOrder controls the tree sorting. If the sorting of the numbers is directly adjusted from the backend, how should the value of TreeOrder be calculated?