| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- <?php
- namespace backendApi\modules\v1\models\lists\bonus;
- use common\helpers\Cache;
- use common\models\PerfMonth;
- use common\models\PerfPeriod;
- use common\models\User as modelUser;
- use common\libs\dataList\column\Price;
- use common\libs\dataList\DataListInterface;
- use common\libs\dataList\column\DateTime;
- use Yii;
- class PerfPeriodList extends \common\libs\dataList\DataList implements DataListInterface
- {
- /**
- * 列表名称
- * @return string
- */
- public function getListName(){
- return '期业绩列表';
- }
- /**
- * 列表筛选到的数据
- * @throws \yii\base\Exception
- */
- public function dataHandle()
- {
- $data = PerfPeriod::lists($this->condition, $this->params, [
- 'select'=>'PP.*, U.USER_NAME, U.REAL_NAME',
- 'from' => PerfPeriod::tableName().' AS PP',
- 'join' => [
- ['LEFT JOIN', modelUser::tableName() . ' AS U', 'U.ID=PP.USER_ID'],
- ],
- 'orderBy' => 'PP.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' => 'Number of periods',//期数
- 'headerOther' => [
- 'width' => '100',
- ],
- ],
- 'USER_NAME' => [
- 'header' => 'Member code',//会员编号
- 'headerOther' => [
- 'width' => '110',
- ],
- ],
- 'REAL_NAME' => [
- 'header' => 'Member name',//会员姓名
- 'headerOther' => [
- 'width' => '150',
- ],
- ],
- 'PV_PCS' => [
- 'header' => 'Personal performance',//个人业绩
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_PCS'],
- ]))->result();
- },
- ],
- 'PV_PCS_ZC' => [
- 'header' => 'Declaration performance',//报单业绩
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_PCS_ZC'],
- ]))->result();
- },
- ],
- 'PV_PCS_FX' => [
- 'header' => 'Cancellation performance',//复消业绩
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_PCS_FX'],
- ]))->result();
- },
- ],
- 'PV_1L' => [
- 'header' => 'I. new market performance',//一市场新增业绩
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_1L'],
- ]))->result();
- },
- ],
- 'PV_1L_ZC' => [
- 'header' => 'I. new performance of market entry',//一市场报单新增业绩
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_1L_ZC'],
- ]))->result();
- },
- ],
- 'PV_1L_FX' => [
- 'header' => 'I. new performance of market re cancellation',//一市场复消新增业绩
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_1L_FX'],
- ]))->result();
- },
- ],
- 'PV_2L' => [
- 'header' => 'II. New market performance',//二市场新增业绩
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_2L'],
- ]))->result();
- },
- ],
- 'PV_2L_ZC' => [
- 'header' => 'II. New performance of market entry',//二市场报单新增业绩
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_2L_ZC'],
- ]))->result();
- },
- ],
- 'PV_2L_FX' => [
- 'header' => 'II. New performance of market re cancellation',//二市场复消新增业绩
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_2L_FX'],
- ]))->result();
- },
- ],
- // 'PV_3L' => [
- // 'header' => '三市场新增业绩',
- // 'headerOther' => [
- // 'width' => '150',
- // ],
- // 'value' => function($row) {
- // return (new Price([
- // 'value' => $row['PV_3L'],
- // ]))->result();
- // },
- // ],
- // 'PV_3L_ZC' => [
- // 'header' => '三市场报单新增业绩',
- // 'headerOther' => [
- // 'width' => '150',
- // ],
- // 'value' => function($row) {
- // return (new Price([
- // 'value' => $row['PV_3L_ZC'],
- // ]))->result();
- // },
- // ],
- // 'PV_3L_FX' => [
- // 'header' => '三市场复消新增业绩',
- // 'headerOther' => [
- // 'width' => '150',
- // ],
- // 'value' => function($row) {
- // return (new Price([
- // 'value' => $row['PV_3L_FX'],
- // ]))->result();
- // },
- // ],
- 'SURPLUS_1L' => [
- 'header' => 'I. market balance performance',//一市场结余业绩
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_1L'],
- ]))->result();
- },
- 'headerOther' => [
- 'width' => '120',
- 'prop'=>'SURPLUS_1L',
- ],
- ],
- 'SURPLUS_2L' => [
- 'header' => 'II. Market balance performance',//二市场结余业绩
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_2L'],
- ]))->result();
- },
- 'headerOther' => [
- 'width' => '120',
- 'prop'=>'SURPLUS_2L',
- ],
- ],
- // 'SURPLUS_3L' => [
- // 'header' => '三市场结余业绩',
- // 'value' => function($row) {
- // return (new Price([
- // 'value' => $row['SURPLUS_3L'],
- // ]))->result();
- // },
- // 'headerOther' => [
- // 'width' => '120',
- // 'prop'=>'SURPLUS_3L',
- // ],
- // ],
- 'SURPLUS_1L_ZC' => [
- 'header' => 'I. market entry balance performance',//一市场报单结余业绩
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_1L_ZC'],
- ]))->result();
- },
- 'headerOther' => [
- 'width' => '120',
- 'prop'=>'SURPLUS_1L_ZC',
- ],
- ],
- 'SURPLUS_2L_ZC' => [
- 'header' => 'II. Market entry balance performance',//二市场报单结余业绩
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_2L_ZC'],
- ]))->result();
- },
- 'headerOther' => [
- 'width' => '120',
- 'prop'=>'SURPLUS_2L_ZC',
- ],
- ],
- // 'SURPLUS_3L_ZC' => [
- // 'header' => '三市场报单结余业绩',
- // 'value' => function($row) {
- // return (new Price([
- // 'value' => $row['SURPLUS_3L_ZC'],
- // ]))->result();
- // },
- // 'headerOther' => [
- // 'width' => '120',
- // 'prop'=>'SURPLUS_3L_ZC',
- // ],
- // ],
- 'SURPLUS_1L_FX' => [
- 'header' => 'I. market reconditioning balance performance',//一市场复消结余业绩
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_1L_FX'],
- ]))->result();
- },
- 'headerOther' => [
- 'width' => '120',
- 'prop'=>'SURPLUS_1L_FX',
- ],
- ],
- 'SURPLUS_2L_FX' => [
- 'header' => 'II. Market re cancellation balance performance',//二市场复消结余业绩
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_2L_FX'],
- ]))->result();
- },
- 'headerOther' => [
- 'width' => '120',
- 'prop'=>'SURPLUS_2L_FX',
- ],
- ],
- // 'SURPLUS_3L_FX' => [
- // 'header' => '三市场复消结余业绩',
- // 'value' => function($row) {
- // return (new Price([
- // 'value' => $row['SURPLUS_3L_FX'],
- // ]))->result();
- // },
- // 'headerOther' => [
- // 'width' => '120',
- // 'prop'=>'SURPLUS_3L_FX',
- // ],
- // ],
- 'PV_PSS' => [
- 'header' => 'Team performance',//团队业绩
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_PSS'],
- ]))->result();
- },
- ],
- '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'=> 'Number of periods'],//期数
- 'USER_NAME'=> ['isUserTable'=> false, 'name'=> 'Member code'],//会员编号
- 'CREATED_AT'=> ['isUserTable'=> false, 'name'=> 'Creation time', 'other'=> 'date'],//创建时间
- ];
- }
- return $this->filterTypes;
- }
- }
|