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' => 'Pay Cycle(PC)', // 结算期数 'headerOther' => [ 'width' => '140', ], ], 'SN' => [ 'header' => 'Sales No',//业绩单编号 'value' => function($row) { return "\t".$row['SN']; }, 'headerOther' => [ 'width' => '250', ], ], 'DEC_TYPE' => [ 'header' => 'Type', // 业绩单类型 'headerOther' => [ 'width' => '130', ], 'value' => function($row){ $decTypes = [ 'ZC'=> 'Welcome Pack Order', // 首购单 'YH'=> 'Coupon', // 优惠单 'ZG'=> 'Additional Purchase Order', // 增购单 'LS'=> 'Retail Order', // 零售单 'FX'=> 'Re Sales Order', // 复销单 ]; return $decTypes[strtoupper($row['DEC_TYPE'])]; }, ], 'DEC_STATUS_NAME' => [ 'header' => 'Status', // 业绩单状态 'headerOther' => [ 'width' => '110', ], ], 'USER_NAME' => [ 'header' => 'Member Code', // 会员编号 'headerOther' => [ 'width' => '110', ], ], 'REAL_NAME' => [ 'header' => 'Member Name', // 会员姓名 'headerOther' => [ 'width' => '150', ], ], 'LAST_REC_USER_NAME' => [ 'header' => 'Sponsor No. At Settlement', // 结算时开拓者编号 'headerOther' => [ 'width' => '190', ], ], 'LAST_REC_REAL_NAME' => [ 'header' => 'Sponsor Name At Settlement', // 结算时开拓者姓名 'headerOther' => [ 'width' => '210', ], ], 'PV' => [ 'header' => 'Entry BV', // 报单BV 'headerOther' => [ 'width' => '150', ], 'value' => function($row) { return (new Price([ 'value' => $row['PV'], ]))->result(); }, ], 'DEC_AMOUNT' => [ 'header' => 'Entry Amount', // 报单金额 'headerOther' => [ 'width' => '150', ], 'value' => function($row) { return (new Price([ 'value' => $row['DEC_AMOUNT'], ]))->result(); }, ], 'DEC_SN' => [ 'header' => 'Entry No', // 报单编号 'headerOther' => [ 'width' => '250', ], ], 'FROM_TABLES' => [ 'header' => 'Order Source', 'headerOther' => [ 'width' => '250', ], ], 'CREATED_AT' => [ 'header' => 'Creation Time', // 创建时间 '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'=> 'Pay Cycle(PC)'], // 结算期数 'SN'=> ['isUserTable'=> false, 'name'=> 'Sales No'], // 业绩单编号 'DEC_STATUS_NAME'=> ['isUserTable'=> false, 'name'=> 'Status','other'=> 'select', 'selectData'=> [['id'=> 1, 'name'=> 'Reviewed'], ['id'=> 2, 'name'=> 'Waste disposal']],], // 业绩单状态,已审核,置废 'USER_NAME'=> ['isUserTable'=> false, 'name'=> 'Member Code'], // 会员编号 'REAL_NAME'=> ['isUserTable'=> false, 'name'=> 'Member Name'], // 会员姓名 'LAST_REC_USER_NAME'=> ['isUserTable'=> false, 'name'=> 'Sponsor No. At Settlement'], // 结算时开拓者编号 'LAST_REC_REAL_NAME'=> ['isUserTable'=> false, 'name'=> 'Sponsor Name At Settlement'], // 结算时开拓者姓名 'PV'=> ['isUserTable'=> false, 'name'=> 'Entry BV'], // 报单BV 'DEC_AMOUNT'=> ['isUserTable'=> false, 'name'=> 'Entry Amount'], // 报单金额 'DEC_SN'=> ['isUserTable'=> false, 'name'=> 'Entry No'], // 报单编号 'CREATED_AT'=> ['isUserTable'=> true, 'name'=> 'Creation Time', 'other'=> 'date'], // 创建时间 ]; } return $this->filterTypes; } }