修正树逻辑,添加获得预获产品券占优惠款,助购券

This commit is contained in:
2020-10-13 23:06:12 +08:00
parent 118fa7d210
commit 6acde199d7
5 changed files with 28 additions and 14 deletions

View File

@ -48,15 +48,13 @@ class UserLevel extends Base
$userId = get_my_id();
$treeArr = [];
$goodsType = 3;
$min = Db::name('orders')->where(compact('userId','goodsType'))->min('helpUserLevel');
if(0 == $min){$min = 1;}
$max = Db::name('orders')->where(compact('userId','goodsType'))->max('helpUserLevel');
$newLevel = 0;
do {
$newLevel++;
$userId = UT::getUpperId($userId);// 找到我的层级
if ($userId == null) $userId = 1;// 上级uid
if (($newLevel >= $min) && UT::checkUserCanDisplay($userId)) {// 如果有,则使用上级信息
if (UT::checkUserCanDisplay($userId)) {// 如果有,则使用上级信息
if($newLevel>10){
$treeArr[$newLevel]['level'] = "".$newLevel."";
}else{