condition, $this->params, [ 'select'=>'PO.*, U.USER_NAME, U.REAL_NAME', 'from' => PerfOrder::tableName().' AS PO', 'join' => [ ['LEFT JOIN', modelUser::tableName() . ' AS U', 'PO.USER_ID=U.ID'], ], 'orderBy' => 'PO.CREATED_AT DESC, PO.ID DESC', 'page' => $this->page, 'pageSize' => $this->pageSize, ]); if($data['list']){ foreach($data['list'] as $key=>$value){ $data['list'][$key]['DEC_STATUS_NAME'] = PerfOrder::STATUS_NAME[$data['list'][$key]['DEC_STATUS']]; } } $this->listData = $data; } /** * 要展示和导出的所有字段 * @return array */ public function getColumn(){ if(!$this->columns){ $this->columns = [ 'PERIOD_NUM' => [ 'header' => '结算期数', 'headerOther' => [ 'width' => '100', ], ], 'SN' => [ 'header' => '业绩单编号', 'value' => function($row) { return "\t".$row['SN']; }, 'headerOther' => [ 'width' => '250', ], ], 'DEC_TYPE' => [ 'header' => '业绩单类型', 'headerOther' => [ 'width' => '110', ], 'value' => function($row){ $decTypes = [ 'ZC'=> '首购单', 'YH'=> '优惠单', 'ZG'=> '增购单', 'LS'=> '零售单', 'FX'=> '复销单', ]; return $decTypes[strtoupper($row['DEC_TYPE'])]; }, ], 'DEC_STATUS_NAME' => [ 'header' => '业绩单状态', 'headerOther' => [ 'width' => '110', ], ], 'USER_NAME' => [ 'header' => '会员编号', 'headerOther' => [ 'width' => '110', ], ], 'REAL_NAME' => [ 'header' => '会员姓名', 'headerOther' => [ 'width' => '150', ], ], 'LAST_REC_USER_NAME' => [ 'header' => '结算时开拓者编号', 'headerOther' => [ 'width' => '150', ], ], 'LAST_REC_REAL_NAME' => [ 'header' => '结算时开拓者姓名', 'headerOther' => [ 'width' => '150', ], ], 'PV' => [ 'header' => '报单PV', 'headerOther' => [ 'width' => '150', ], 'value' => function($row) { return (new Price([ 'value' => $row['PV'], ]))->result(); }, ], 'DEC_AMOUNT' => [ 'header' => '报单金额', 'headerOther' => [ 'width' => '150', ], 'value' => function($row) { return (new Price([ 'value' => $row['DEC_AMOUNT'], ]))->result(); }, ], 'DEC_SN' => [ 'header' => '报单编号', 'headerOther' => [ 'width' => '250', ], ], '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'=> '结算期数'], 'SN'=> ['isUserTable'=> false, 'name'=> '业绩单编号'], 'DEC_STATUS_NAME'=> ['isUserTable'=> false, 'name'=> '业绩单状态','other'=> 'select', 'selectData'=> [['id'=> 1, 'name'=> '已审核'], ['id'=> 2, 'name'=> '置废']],], 'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'], 'REAL_NAME'=> ['isUserTable'=> false, 'name'=> '会员姓名'], 'LAST_REC_USER_NAME'=> ['isUserTable'=> false, 'name'=> '结算时开拓者编号'], 'LAST_REC_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '结算时开拓者姓名'], 'PV'=> ['isUserTable'=> false, 'name'=> '报单PV'], 'DEC_AMOUNT'=> ['isUserTable'=> false, 'name'=> '报单金额'], 'DEC_SN'=> ['isUserTable'=> false, 'name'=> '报单编号'], 'CREATED_AT'=> ['isUserTable'=> true, 'name'=> '创建时间', 'other'=> 'date'], ]; } return $this->filterTypes; } }