others['yearMonth']; $data = CalcBonusBD::lists($this->condition, $this->params, [ 'select' => 'CBB.*', 'from' => CalcBonusBD::tableName() . ' AS CBB', 'join' => [ ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CBB.USER_ID=UI.USER_ID'], ], 'orderBy' => 'CBB.CREATED_AT ASC, CBB.ID ASC', 'yearMonth' => $yearMonth, 'page' => $this->page, 'pageSize' => $this->pageSize, ]); if ($data['list']) { foreach ($data['list'] as $key => $value) { $userInfo = Info::baseInfoZh($value['FROM_USER_ID']); $data['list'][$key] = array_merge($userInfo, $value); $data['list'][$key]['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$value['LAST_FROM_DEC_LV']]['LEVEL_NAME'] ?? ''; $data['list'][$key]['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$value['LAST_FROM_EMP_LV']]['LEVEL_NAME'] ?? ''; $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_FROM_STATUS']]['label'] ?? ''; } } $this->listData = $data; } /** * 要展示和导出的所有字段 * @return array */ public function getColumn(){ if(!$this->columns){ $this->columns = [ 'PERIOD_NUM' => [ 'header' => '结算期数', ], 'USER_NAME' => [ 'header' => '提供者编号', 'headerOther' => [ 'width' => '150', ], 'valueOther' => [ 'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'] ], ], 'REAL_NAME' => [ 'header' => '提供者姓名', 'headerOther' => [ 'width' => '120', ], 'valueOther' => [ 'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border'] ], ], 'LAST_STATUS_NAME' => [ 'header' => '结算时状态', 'headerOther' => [ 'width' => '110', ], ], 'LAST_DEC_LV_NAME' => [ 'header' => '结算时会员级别', 'headerOther' => [ 'width' => '120', ], ], 'LAST_EMP_LV_NAME' => [ 'header' => '结算时会员聘级', 'headerOther' => [ 'width' => '140', ], ], 'AMOUNT' => [ 'header' => '服务奖金额', 'headerOther' => [ 'width' => '150', ], 'value' => function($row) { return (new Price([ 'value' => $row['AMOUNT'], ]))->result(); }, 'valueOther' => function($row){ return [ 'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'], ]; }, ], 'ORI_BONUS' => [ 'header' => '原金额', 'headerOther' => [ 'width' => '150', ], 'value' => function($row) { return (new Price([ 'value' => $row['ORI_BONUS'], ]))->result(); }, 'valueOther' => function($row){ return [ 'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'], ]; }, ], 'RECONSUME_POINTS' => [ 'header' => '复消积分', 'headerOther' => [ 'width' => '150', ], 'value' => function($row) { return (new Price([ 'value' => $row['RECONSUME_POINTS'], ]))->result(); }, 'valueOther' => function($row){ return [ 'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'], ]; }, ], 'MANAGE_TAX' => [ 'header' => '管理费', 'headerOther' => [ 'width' => '150', ], 'value' => function($row) { return (new Price([ 'value' => $row['MANAGE_TAX'], ]))->result(); }, 'valueOther' => function($row){ return [ 'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'], ]; }, ], 'CALC_MONTH' => [ 'header' => '结算月', 'headerOther' => [ 'width' => '110', ], ], ]; } return $this->columns; } /** * 前台用于筛选的类型集合 * @return mixed */ public function getFilterTypes() { if(!$this->filterTypes){ $this->filterTypes = []; } return $this->filterTypes; } }