problem description
scenario: multiple loops with different rules, go back to level 7 online.
defined rules (written in config)
related codes
Rule definition (written in config)
"distribution" =>[
"vip" =>[//VIP
"vip_platinum" => "0.05", //5%
"vip_platinum_platinum" => "0.02", //2%
"vip_diamond" => "0.07", //7%
"vip_diamond_diamond" => "0.04", //4%
"vip_diamond_platinum" => "0.02", //2%
"vip_two" => "0.03", //3%
"vip_two_two" => "0.01", //1%;
],
"platinum" => [//
"platinum_platinum" => "0.02", //2%
"platinum_platinum_diamond" => "0.05", // 2%5%
"platinum_diamond" => "0.05", //5%
"platinum_diamond_diamond" => "0.02", //2%
],
"diamond" => [//
"diamond_diamond" => "0.04", //4%
],
"two" => [//
"two_two" => "0.01", // 1%
"two_one" => "0.01",//1 %
],
],
stupid method
Infinite judgment. Each level judges the level of the superior. If it is not satisfied, trace it back to the seventh level
Smart method
is there any other clever way?