|
@@ -82,9 +82,9 @@ class MemberService extends BaseService
|
|
|
}
|
|
}
|
|
|
$field = $field ? $field : $defaultField;
|
|
$field = $field ? $field : $defaultField;
|
|
|
if (is_array($where)) {
|
|
if (is_array($where)) {
|
|
|
- $info = $this->model->with(['merchant','acceptor','parent'])->where('mark',1)->where($where)->select($field)->first();
|
|
|
|
|
|
|
+ $info = $this->model->with(['merchant','acceptor','parent','point','level'])->where('mark',1)->where($where)->select($field)->first();
|
|
|
} else {
|
|
} else {
|
|
|
- $info = $this->model->with(['merchant','acceptor','parent'])->where('mark',1)->where(['id' => (int)$where])->select($field)->first();
|
|
|
|
|
|
|
+ $info = $this->model->with(['merchant','acceptor','parent','point','level'])->where('mark',1)->where(['id' => (int)$where])->select($field)->first();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$info = $info ? $info->toArray() : [];
|
|
$info = $info ? $info->toArray() : [];
|
|
@@ -119,7 +119,9 @@ class MemberService extends BaseService
|
|
|
$info['live_open'] = $info['member_level']>=$liveOpenLevel? 1 : 0;
|
|
$info['live_open'] = $info['member_level']>=$liveOpenLevel? 1 : 0;
|
|
|
}
|
|
}
|
|
|
else if ($type == 'team') {
|
|
else if ($type == 'team') {
|
|
|
-
|
|
|
|
|
|
|
+ $info['team_count1'] = $this->getUserCountByType($info['id'], 1, 0); // 直推人数
|
|
|
|
|
+ $info['team_count2'] = $this->getUserCountByType($info['id'], 3, 0); // 滑落人数
|
|
|
|
|
+ $info['team_count'] = $this->getUserCountByType($info['id'], 1, 1); // 节点推荐人数
|
|
|
}else {
|
|
}else {
|
|
|
// 默认地址
|
|
// 默认地址
|
|
|
$info['addressData'] = MemberAddressService::make()->getBindInfo($info['id']);
|
|
$info['addressData'] = MemberAddressService::make()->getBindInfo($info['id']);
|
|
@@ -231,16 +233,18 @@ class MemberService extends BaseService
|
|
|
$data = $this->model->where($where)
|
|
$data = $this->model->where($where)
|
|
|
->where(function ($query) use ($type, $isPoint, $userId) {
|
|
->where(function ($query) use ($type, $isPoint, $userId) {
|
|
|
if($isPoint){
|
|
if($isPoint){
|
|
|
- if ($type == 1) {
|
|
|
|
|
|
|
+ if ($type == 1) { // 滑落推荐
|
|
|
$query->where('point_id', $userId);
|
|
$query->where('point_id', $userId);
|
|
|
- } else if($type == 2){
|
|
|
|
|
|
|
+ } else if($type == 2){ // 滑落团队人数
|
|
|
$query->whereRaw('FIND_IN_SET(?,points)', $userId);
|
|
$query->whereRaw('FIND_IN_SET(?,points)', $userId);
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
|
- if ($type == 1) {
|
|
|
|
|
|
|
+ if ($type == 1) { // 直推人数
|
|
|
$query->where('parent_id', $userId);
|
|
$query->where('parent_id', $userId);
|
|
|
- } else if($type == 2){
|
|
|
|
|
|
|
+ } else if($type == 2){ // 团队人数
|
|
|
$query->whereRaw('FIND_IN_SET(?,parents)', $userId);
|
|
$query->whereRaw('FIND_IN_SET(?,parents)', $userId);
|
|
|
|
|
+ } else if($type == 3){ // 滑落人数
|
|
|
|
|
+ $query->where('parent_id', $userId)->where('point_id','!=', $userId);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})->count('id');
|
|
})->count('id');
|