condition, $this->params, [ 'select'=>'UP.*, U.USER_NAME, U.REAL_NAME, C.NAME AS COUNTRY', 'from' => UserPerf::tableName().' AS UP', 'join' => [ ['INNER JOIN', modelUser::tableName() . ' AS U', 'UP.USER_ID=U.ID'], ['INNER JOIN', Countries::tableName() . ' AS C', 'U.COUNTRY_ID=C.ID'], ], 'orderBy' => 'UP.ID DESC', 'page' => $this->page, 'pageSize' => $this->pageSize, ]); $this->listData = $data; } /** * 要展示和导出的所有字段 * @return array */ public function getColumn(){ if(!$this->columns){ $this->columns = [ 'USER_NAME' => [ 'header' => Yii::t('ctx', 'memberCode'), // 会员编号 'headerOther' => [ 'width' => '200', ], ], 'REAL_NAME' => [ 'header' => Yii::t('ctx', 'memberName'), // 会员姓名 'headerOther' => [ 'width' => '200', ], ], 'COUNTRY' => [ 'header' => Yii::t('ctx', 'country'), ], 'PV_PCS' => [ 'header' => Yii::t('ctx', 'personalPerformance'), // 个人业绩 'headerOther' => [ 'width' => '180', ], 'value' => function($row) { return (new Price([ 'value' => $row['PV_PCS_ZC'] + $row['PV_PCS_FX'], ]))->result(); }, ], // 'SURPLUS_1L' => [ // 'header' => Yii::t('ctx', 'remainderLeftLeg'), // 一市场剩余业绩 // 'headerOther' => [ // 'width' => '240', // ], // 'value' => function($row) { // return (new Price([ // 'value' => $row['SURPLUS_1L'], // ]))->result(); // }, // ], // 'SURPLUS_2L' => [ // 'header' => Yii::t('ctx', 'remainderRightLeg'), // 二市场剩余业绩 // 'headerOther' => [ // 'width' => '240', // ], // 'value' => function($row) { // return (new Price([ // 'value' => $row['SURPLUS_2L'], // ]))->result(); // }, // ], 'PV_PSS_TOTAL' => [ 'header' => Yii::t('ctx', 'cumulativeTeamPerformance'), // 累计团队业绩 'headerOther' => [ 'width' => '250', ], 'value' => function($row) { return (new Price([ 'value' => $row['PV_PSS_TOTAL'], ]))->result(); }, ], ]; } return $this->columns; } /** * 前台用于筛选的类型集合 * @return mixed */ public function getFilterTypes() { if(!$this->filterTypes){ $this->filterTypes = [ 'USER_NAME'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'memberCode')], // 会员编号 ]; } return $this->filterTypes; } }