condition, $this->params, [ 'select'=>'PM.*, U.USER_NAME, U.REAL_NAME', 'from' => PerfPeriod::tableName().' AS PM', 'join' => [ ['LEFT JOIN', modelUser::tableName() . ' AS U', 'PM.USER_ID=U.ID'], ], 'orderBy' => 'PM.CREATED_AT DESC, PM.ID DESC', 'page' => $this->page, 'pageSize' => $this->pageSize, ]); if ($data['list']) { foreach ($data['list'] as $key => $value) { $data['list'][$key]['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$value['LAST_DEC_LV']]['LEVEL_NAME'] ?? ''; $data['list'][$key]['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$value['LAST_EMP_LV']]['LEVEL_NAME'] ?? ''; } } $this->listData = $data; } /** * 要展示和导出的所有字段 * @return array */ public function getColumn(){ if(!$this->columns){ $this->columns = [ 'PERIOD_NUM' => [ 'header' => '期数', 'headerOther' => [ 'width' => '100', ], ], 'USER_NAME' => [ 'header' => '会员编号', 'headerOther' => [ 'width' => '110', ], ], 'REAL_NAME' => [ 'header' => '会员姓名', 'headerOther' => [ 'width' => '150', ], ], 'LAST_DEC_LV_NAME' => [ 'header' => '结算时会员级别', 'headerOther' => [ 'width' => '150', ], ], 'LAST_EMP_LV_NAME' => [ 'header' => '结算时会员聘级', 'headerOther' => [ 'width' => '150', ], ], 'PV_PCS' => [ 'header' => '个人业绩', 'headerOther' => [ 'width' => '150', ], 'value' => function($row) { return (new Price([ 'value' => $row['PV_PCS'], ]))->result(); }, ], 'PV_PSS' => [ 'header' => '新增团队业绩', 'headerOther' => [ 'width' => '150', ], 'value' => function($row) { return (new Price([ 'value' => $row['PV_PSS'], ]))->result(); }, ], 'CREATED_AT' => [ 'header' => '创建时间', 'value' => function($row) { return (new DateTime([ 'value' => $row['CREATED_AT'], ]))->result(); }, 'headerOther' => ['width' => '170'], ], ]; } return $this->columns; } /** * 前台用于筛选的类型集合 * @return mixed */ public function getFilterTypes() { if(!$this->filterTypes){ $this->filterTypes = [ 'PERIOD_NUM'=> ['isUserTable'=> false, 'name'=> '期数'], 'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'], 'CREATED_AT'=> ['isUserTable'=> false, 'name'=> '创建时间', 'other'=> 'date'], ]; } return $this->filterTypes; } }