|
@@ -234,15 +234,14 @@ class MemberService extends BaseService
|
|
|
// 滑落节点
|
|
// 滑落节点
|
|
|
$pointId = 0;
|
|
$pointId = 0;
|
|
|
$points = '';
|
|
$points = '';
|
|
|
- $pointSorts = '';
|
|
|
|
|
|
|
+ $pointSort = $userId;
|
|
|
if($rid>0){
|
|
if($rid>0){
|
|
|
$pointData = $this->getPointParentId($rid);
|
|
$pointData = $this->getPointParentId($rid);
|
|
|
$pointId = isset($pointData['point_id'])?$pointData['point_id'] : 0;
|
|
$pointId = isset($pointData['point_id'])?$pointData['point_id'] : 0;
|
|
|
- $pointSort = isset($pointData['point_sort']) && $pointData['point_sort']?$pointData['point_sort'] : 0;
|
|
|
|
|
|
|
+ $pointSort = isset($pointData['point_sort']) && $pointData['point_sort']?$pointData['point_sort'] : $pointSort;
|
|
|
if($pointId){
|
|
if($pointId){
|
|
|
$pointParent = $this->model->where(['id'=> $pointId,'mark'=>1])->select(['id','points','point_sort'])->first();
|
|
$pointParent = $this->model->where(['id'=> $pointId,'mark'=>1])->select(['id','points','point_sort'])->first();
|
|
|
$points = isset($pointParent['points']) && $pointParent['points']? $pointParent['points'].$pointId.',' : ($pointId ? $pointId . ',' : '');
|
|
$points = isset($pointParent['points']) && $pointParent['points']? $pointParent['points'].$pointId.',' : ($pointId ? $pointId . ',' : '');
|
|
|
- $pointSorts = isset($pointParent['point_sort']) && $pointParent['point_sort']? $pointParent['point_sort'].''.$pointSort : $pointSort;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -258,7 +257,7 @@ class MemberService extends BaseService
|
|
|
'buy_type' => $areaId,
|
|
'buy_type' => $areaId,
|
|
|
'area_id' => $areaId,
|
|
'area_id' => $areaId,
|
|
|
'points' => $points,
|
|
'points' => $points,
|
|
|
- 'point_sort' => $pointSorts,
|
|
|
|
|
|
|
+ 'point_sort' => $pointSort,
|
|
|
'code' => get_random_code(9, 'Q', $userId),
|
|
'code' => get_random_code(9, 'Q', $userId),
|
|
|
'password' => get_password('a123456'),
|
|
'password' => get_password('a123456'),
|
|
|
'login_ip' => get_client_ip(),
|
|
'login_ip' => get_client_ip(),
|
|
@@ -327,7 +326,7 @@ class MemberService extends BaseService
|
|
|
// 上级
|
|
// 上级
|
|
|
$userInfo = $this->model->where(['id'=>$userId])->select(['id','parent_id','point_sort','point_id'])->first();
|
|
$userInfo = $this->model->where(['id'=>$userId])->select(['id','parent_id','point_sort','point_id'])->first();
|
|
|
$parentId = isset($userInfo['parent_id'])?$userInfo['parent_id']:0;
|
|
$parentId = isset($userInfo['parent_id'])?$userInfo['parent_id']:0;
|
|
|
- $pointSort = isset($userInfo['point_sort'])&&$userInfo['point_sort']?$userInfo['point_sort']:1;
|
|
|
|
|
|
|
+ $pointSort = isset($userInfo['point_sort'])&&$userInfo['point_sort']?$userInfo['point_sort']:0;
|
|
|
$model = $this->model->where(['mark'=> 1]);
|
|
$model = $this->model->where(['mark'=> 1]);
|
|
|
|
|
|
|
|
$model1= clone $model;
|
|
$model1= clone $model;
|
|
@@ -353,7 +352,7 @@ class MemberService extends BaseService
|
|
|
->get();
|
|
->get();
|
|
|
$userList = $userList? $userList->toArray() : [];
|
|
$userList = $userList? $userList->toArray() : [];
|
|
|
if($childrenCount < 2){
|
|
if($childrenCount < 2){
|
|
|
- return ['point_id'=>$userId,'point_sort'=>($pointSort*$pointSort+($childrenCount+1)),'index'=>$childrenCount+1];
|
|
|
|
|
|
|
+ return ['point_id'=>$userId,'point_sort'=>$pointSort?($pointSort*$pointSort+($childrenCount+1)):0,'index'=>$childrenCount+1];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -365,7 +364,7 @@ class MemberService extends BaseService
|
|
|
$pointSort = 0;
|
|
$pointSort = 0;
|
|
|
foreach ($userList as $item) {
|
|
foreach ($userList as $item) {
|
|
|
$id = isset($item['id'])? $item['id'] : 0;
|
|
$id = isset($item['id'])? $item['id'] : 0;
|
|
|
- $sort = isset($item['point_sort']) && $item['point_sort']? $item['point_sort'] : 1;
|
|
|
|
|
|
|
+ $sort = isset($item['point_sort']) && $item['point_sort']? $item['point_sort'] : 0;
|
|
|
$children = isset($item['points_count']) && $item['points_count']? $item['points_count'] : 0;
|
|
$children = isset($item['points_count']) && $item['points_count']? $item['points_count'] : 0;
|
|
|
|
|
|
|
|
$points = isset($item['points']) && $item['points']? explode(',', $item['points']) : [];
|
|
$points = isset($item['points']) && $item['points']? explode(',', $item['points']) : [];
|
|
@@ -378,7 +377,7 @@ class MemberService extends BaseService
|
|
|
$pointId = $id;
|
|
$pointId = $id;
|
|
|
$tempPointLen = $pointLen;
|
|
$tempPointLen = $pointLen;
|
|
|
$tempChildren = $children+1;
|
|
$tempChildren = $children+1;
|
|
|
- $pointSort = $sort*$sort + $tempChildren;
|
|
|
|
|
|
|
+ $pointSort = $sort?($sort*$sort + $tempChildren) : 0;
|
|
|
//dump("ID:{$id}-{$children}命中");
|
|
//dump("ID:{$id}-{$children}命中");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|