others['userId']; $deep = $this->others['deep']; $periodNum = $this->others['periodNum']; $period = Period::instance(); $mainUserInfo = Info::baseInfo($userId, $periodNum); $decLevelConfig = Cache::getDecLevelConfig(); $empLevelConfig = Cache::getEmpLevelConfig(); $param = []; if ( $this->pageSize ) $param['pageSize'] = $this->pageSize; if ( $this->page !== null ) $param['page'] = $this->page; $this->listData = UserRelation::getChildrenInDeepFromPeriodWithPage($userId, $deep, $periodNum, $param); foreach($this->listData['list'] as $key=>$value){ $userBaseInfo = Info::baseInfo($value['USER_ID'], $periodNum); $this->listData['list'][$key]['LIST_PERIOD_NUM'] = $periodNum?$periodNum:$period->getNowPeriodNum(); $this->listData['list'][$key]['COUNT_DEEP'] = (int)($userBaseInfo['RELATION_DEEP']); $this->listData['list'][$key]['USER_NAME'] = $userBaseInfo['USER_NAME']; $this->listData['list'][$key]['SEE_USER_NAME'] = $userBaseInfo['USER_NAME']; $this->listData['list'][$key]['REAL_NAME'] = $userBaseInfo['REAL_NAME']; $this->listData['list'][$key]['PERIOD_AT'] = $userBaseInfo['PERIOD_AT']; $this->listData['list'][$key]['DEC_LV_NAME'] = $decLevelConfig[$userBaseInfo['DEC_LV']]['LEVEL_NAME']; $this->listData['list'][$key]['EMP_LV_NAME'] = isset($empLevelConfig[$userBaseInfo['EMP_LV']])?$empLevelConfig[$userBaseInfo['EMP_LV']]['LEVEL_NAME']:''; } $this->listData['periodNum'] = $periodNum; $this->listData['listTopDeep'] = $mainUserInfo['RELATION_DEEP']; } /** * 要展示和导出的所有字段 * @return array */ public function getColumn() { if (!$this->columns) { $this->columns = [ 'USER_ID' => null, // 这种传输方式主要是用于索引,因为过滤后的字段可能没有这种ID,但是一些功能的操作还需要用这种ID去关联,例如前台会员列表中的勾选批量状态管理,这里需要的就是USER_ID 'SEE_USER_NAME' => null, // 'LIST_PERIOD_NUM' => [ // 'header' => '期数', // 'headerOther' => ['width' => '110'], // ], 'COUNT_DEEP' => [ 'header' => 'Number of layers',//层数 'headerOther' => ['width' => '100'], ], 'USER_NAME' => [ 'header' => 'Recommended member No',//推荐会员编号 // 'headerOther' => ['width' => '150'], ], 'REAL_NAME' => [ 'header' => 'Name of recommended member',//推荐会员姓名 // 'headerOther' => [ // 'width' => '120', // ], ], 'DEC_LV_NAME' => [ 'header' => 'Recommended member level',//推荐会员级别 'headerOther' => [ 'width' => '110', ], ], 'EMP_LV_NAME' => [ 'header' => 'Recommended member Rank',//推荐会员聘级 'headerOther' => [ 'width' => '130', ], ], 'PERIOD_AT' => [ 'header' => 'Number of joining periods',//加入期数 'headerOther' => ['width' => '110'], ], ]; } return $this->columns; } /** * 前台用于筛选的类型集合 * @return mixed */ public function getFilterTypes() { if (!$this->filterTypes) { $this->filterTypes = [ 'userName' => ['isUserTable' => false, 'name' => 'Member code'],//会员编号 'deep' => ['isUserTable' => false, 'name' => 'depth'],//深度 'periodNum' => ['isUserTable' => false, 'name' => 'Number of periods'],//期数 ]; } return $this->filterTypes; } }