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 = UserNetwork::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['NETWORK_DEEP']-$mainUserInfo['NETWORK_DEEP']); $this->listData['list'][$key]['COUNT_DEEP'] = (int)($userBaseInfo['NETWORK_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['NETWORK_DEEP']; } /** * 要展示和导出的所有字段 * @return array */ public function getColumn() { if (!$this->columns) { $this->columns = [ 'USER_ID' => null, // 这种传输方式主要是用于索引,因为过滤后的字段可能没有这种ID,但是一些功能的操作还需要用这种ID去关联,例如前台会员列表中的勾选批量状态管理,这里需要的就是USER_ID 'SEE_USER_NAME' => null, 'COUNT_DEEP' => [ 'header' => '层数', 'headerOther' => ['width' => '100'], ], 'USER_NAME' => [ 'header' => '安置会员编号', // 'headerOther' => ['width' => '150'], ], 'REAL_NAME' => [ 'header' => '安置会员姓名', // 'headerOther' => [ // 'width' => '120', // ], ], // 'LOCATION' => [ // 'header' => '区位', // 'value' => function($row) { // return 'A'.$row['LOCATION']; // }, // 'headerOther' => ['width' => '110'], // ], 'DEC_LV_NAME' => [ 'header' => '推荐会员级别', 'headerOther' => [ 'width' => '110', ], ], 'EMP_LV_NAME' => [ 'header' => '推荐会员聘级', 'headerOther' => [ 'width' => '130', ], ], 'PERIOD_AT' => [ 'header' => '加入期数', 'headerOther' => ['width' => '110'], ], ]; } return $this->columns; } /** * 前台用于筛选的类型集合 * @return mixed */ public function getFilterTypes() { if (!$this->filterTypes) { $this->filterTypes = [ 'userName' => ['isUserTable' => false, 'name' => '会员编号'], 'deep' => ['isUserTable' => false, 'name' => '深度'], 'periodNum' => ['isUserTable' => false, 'name' => '期数'], ]; } return $this->filterTypes; } }