|
|
@@ -394,12 +394,12 @@ class MemberService extends BaseService
|
|
|
return $info;
|
|
|
}
|
|
|
|
|
|
- $defaultField = ['id', 'user_type', 'realname', 'mobile','is_auth','member_level','vip_growth','vip_expired','idcard', 'nickname','parent_id', 'balance','bonus_total','withdraw_total', 'code', 'openid','create_time', 'status', 'avatar'];
|
|
|
+ $defaultField = ['id', 'user_type', 'realname', 'mobile','is_auth','member_level','idcard', 'nickname','parent_id','point_id', 'balance','ls_score','bd_score','bonus_total','withdraw_total', 'code', 'openid','create_time', 'status', 'avatar'];
|
|
|
$field = $field ? $field : $defaultField;
|
|
|
if (is_array($where)) {
|
|
|
- $info = $this->model->with(['parent'])->where(['mark' => 1])->where($where)->select($field)->first();
|
|
|
+ $info = $this->model->with(['parent','point'])->where(['mark' => 1])->where($where)->select($field)->first();
|
|
|
} else {
|
|
|
- $info = $this->model->with(['parent'])->where(['mark' => 1])->where(['id' => (int)$where])->select($field)->first();
|
|
|
+ $info = $this->model->with(['parent','point'])->where(['mark' => 1])->where(['id' => (int)$where])->select($field)->first();
|
|
|
}
|
|
|
|
|
|
$info = $info ? $info->toArray() : [];
|
|
|
@@ -418,18 +418,8 @@ class MemberService extends BaseService
|
|
|
}
|
|
|
|
|
|
if($type == 'center'){
|
|
|
- $info['uppers'] = $info['parent']?[$info['parent']]:[];
|
|
|
- $info['upper_count'] = $info['parent']?1: 0;
|
|
|
- $query = $this->model->where(['parent_id'=>$info['id'],'mark'=>1])->select(['id','avatar','nickname','status']);
|
|
|
- $query1 = clone $query;
|
|
|
- $info['user_count'] = $query1->count('id');
|
|
|
- $info['users'] = $query->limit(3)->get();
|
|
|
-
|
|
|
- // 成长值
|
|
|
- $levelGrowth = ConfigService::make()->getConfigByCode('vip_growth_'.$info['member_level']+1);
|
|
|
- $info['vip_growth_diff'] = $levelGrowth>0?ceil(max(0,$levelGrowth-$info['vip_growth'])) : 0;
|
|
|
- $info['vip_growth_1'] = ConfigService::make()->getConfigByCode('vip_growth_1');
|
|
|
- $info['vip_growth_2'] = ConfigService::make()->getConfigByCode('vip_growth_2');
|
|
|
+ $info['point_count'] = $this->model->where(['point_id'=>$info['id'],'mark'=>1])->count('id');
|
|
|
+ $info['user_count'] = $this->model->where(['parent_id'=>$info['id'],'mark'=>1])->count('id');
|
|
|
}
|
|
|
|
|
|
RedisService::set($cacheKey, $info, rand(10, 20));
|