Просмотр исходного кода

后端奖金列表改最高聘级

York 3 лет назад
Родитель
Сommit
3b26493a30
21 измененных файлов с 5083 добавлено и 5083 удалено
  1. 555 555
      backendApi/modules/v1/models/lists/bonus/OtherPeriodBonusList.php
  2. 228 228
      backendApi/modules/v1/models/lists/bonus/PerfMonthList.php
  3. 152 152
      backendApi/modules/v1/models/lists/bonus/PerfStandardList.php
  4. 713 713
      backendApi/modules/v1/models/lists/bonus/PeriodBonusList.php
  5. 135 135
      backendApi/modules/v1/models/lists/bonus/PeriodPerfList.php
  6. 201 201
      backendApi/modules/v1/models/lists/bonus/TraceDownBdList.php
  7. 200 200
      backendApi/modules/v1/models/lists/bonus/TraceDownGlList.php
  8. 201 201
      backendApi/modules/v1/models/lists/bonus/TraceDownGxList.php
  9. 182 182
      backendApi/modules/v1/models/lists/bonus/TraceDownQyList.php
  10. 201 201
      backendApi/modules/v1/models/lists/bonus/TraceDownTgList.php
  11. 202 202
      backendApi/modules/v1/models/lists/bonus/TraceDownXfList.php
  12. 165 165
      backendApi/modules/v1/models/lists/bonus/TraceDownYcList.php
  13. 200 200
      backendApi/modules/v1/models/lists/bonus/TraceDownYjList.php
  14. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpBdList.php
  15. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpGlList.php
  16. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpGxList.php
  17. 306 306
      backendApi/modules/v1/models/lists/bonus/TraceUpQyList.php
  18. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpTgList.php
  19. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpXfList.php
  20. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpYcList.php
  21. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpYjList.php

+ 555 - 555
backendApi/modules/v1/models/lists/bonus/OtherPeriodBonusList.php

@@ -1,556 +1,556 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\Cache;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\PerfOrder;
-use common\models\Period;
-use common\models\Region;
-use common\models\User as modelUser;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserPerf;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class OtherPeriodBonusList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '往期奖金列表';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $this->listData = CalcBonus::lists($this->condition, $this->params, [
-            //'select'=>'CB.*, UP.SURPLUS_1L AS UP_SURPLUS_1L, UP.SURPLUS_2L AS UP_SURPLUS_2L, UP.SURPLUS_3L AS UP_SURPLUS_3L,UI.CON_UID,UI.REC_UID',
-            'select'=>'CB.*,UI.CON_UID,UI.REC_UID',
-            'from' => CalcBonus::tableName().' AS CB',
-            'join' => [
-                //['LEFT JOIN', UserPerf::tableName() . ' AS UP', 'CB.USER_ID=UP.USER_ID'],
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CB.USER_ID=UI.USER_ID'],
-            ],
-            'yearMonth' => $yearMonth,
-            'orderBy' => 'CB.CREATED_AT DESC, CB.ID DESC',
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        unset($yearMonth);
-        if ($this->listData['list']) {
-            foreach ($this->listData['list'] as $key => $value) {
-                $this->listData['list'][$key]['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$value['LAST_DEC_LV']]['LEVEL_NAME'];
-                $this->listData['list'][$key]['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$value['LAST_EMP_LV']]['LEVEL_NAME'];
-                $this->listData['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_STATUS']]['label'];
-
-                $this->listData['list'][$key]['LAST_REC_USER_NAME'] = Info::getUserNameByUserId($value['REC_UID']);
-                $this->listData['list'][$key]['LAST_REC_REAL_NAME'] = Info::getUserRealNameByUserId($value['REC_UID']);
-                $this->listData['list'][$key]['LAST_CON_USER_NAME'] = Info::getUserNameByUserId($value['CON_UID']);
-                $this->listData['list'][$key]['LAST_CON_REAL_NAME'] = Info::getUserRealNameByUserId($value['CON_UID']);
-            }
-        }
-    }
-
-    /**
-     * 要展示和导出的所有字段
-     * @return array
-     */
-    public function getColumn(){
-        if(!$this->columns){
-            $this->columns = [
-                'ID' => null,
-                'PERIOD_NUM' => [
-                    'header' => '结算期数',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'', 'size' => 'small', 'class'=>'no-border'],
-                    ],
-                ],
-                'CALCULATED_AT' => [
-                    'header' => '结算时间',
-                    'value' => function($row) {
-                        return (new DateTime([
-                            'value' => $row['CALCULATED_AT'],
-                        ]))->result();
-                    },
-                    'headerOther' => ['width' => '170'],
-                ],
-                'LAST_USER_NAME' => [
-                    'header' => '会员编号',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border']
-                    ],
-                ],
-                'LAST_REAL_NAME' => [
-                    'header' => '会员姓名',
-                    'headerOther' => [
-                        'width' => '120',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border']
-                    ],
-                ],
-                'LAST_DEC_LV_NAME' => [
-                    'header' => '结算时会员级别',
-                    'headerOther' => [
-                        'width' => '120',
-                    ],
-                ],
-                'LAST_EMP_LV_NAME' => [
-                    'header' => '结算时会员聘级',
-                    'headerOther' => [
-                        'width' => '140',
-                    ],
-                ],
-                'LAST_MOBILE' => [
-                    'header' => '手机号码',
-                    'headerOther' => [
-                        'width' => '120',
-                    ],
-                ],
-                'LAST_PERIOD_AT' => [
-                    'header' => '加入期数',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-                'LAST_CREATED_AT' => [
-                    'header' => '加入时间',
-                    'value' => function($row) {
-                        return (new DateTime([
-                            'value' => $row['LAST_CREATED_AT'],
-                        ]))->result();
-                    },
-                    'headerOther' => ['width' => '170'],
-                ],
-                'LAST_REC_USER_NAME' => [
-                    'header' => '开拓者编号',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'LAST_REC_REAL_NAME' => [
-                    'header' => '开拓者姓名',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-                'LAST_CON_USER_NAME' => [
-                    'header' => '上级编号',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'LAST_CON_REAL_NAME' => [
-                    'header' => '上级姓名',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-                'PV_1L' => [
-                    'header' => '一市场新增业绩',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_1L'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'PV_1L',
-                    ],
-                ],
-                'SURPLUS_1L' => [
-                    'header' => '一市场结余业绩',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['SURPLUS_1L'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'SURPLUS_1L',
-                    ],
-                ],
-                'PV_2L' => [
-                    'header' => '二市场新增业绩',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_2L'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'PV_2L',
-                    ],
-                ],
-                'SURPLUS_2L' => [
-                    'header' => '二市场结余业绩',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['SURPLUS_2L'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'SURPLUS_2L',
-                    ],
-                ],
-//                'UP_SURPLUS_2L' => [
-//                    'header' => '当前二市场结余业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['UP_SURPLUS_2L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'UP_SURPLUS_2L',
-//                    ],
-//                ],
-                'PV_3L' => [
-                    'header' => '三市场新增业绩',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_3L'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'PV_3L',
-                    ],
-                ],
-                'SURPLUS_3L' => [
-                    'header' => '三市场结余业绩',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['SURPLUS_3L'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'SURPLUS_3L',
-                    ],
-                ],
-//                'UP_SURPLUS_3L' => [
-//                    'header' => '当前三市场结余业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['UP_SURPLUS_3L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'UP_SURPLUS_3L',
-//                    ],
-//                ],
-                'BONUS_BD' => [
-                    'header' => '服务奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_BD'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_BD',
-                    ],
-                ],
-                'ORI_BONUS_BD' => [
-                    'header' => '服务奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_BD'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_BD',
-                    ],
-                ],
-                'BONUS_TG' => [
-                    'header' => '推广奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_TG'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_TG',
-                    ],
-                ],
-                'ORI_BONUS_TG' => [
-                    'header' => '推广奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_TG'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_TG',
-                    ],
-                ],
-                'BONUS_XF' => [
-                    'header' => '消费奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_XF'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_XF',
-                    ],
-                ],
-                'ORI_BONUS_XF' => [
-                    'header' => '消费奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_XF'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_XF',
-                    ],
-                ],
-                'BONUS_YJ' => [
-                    'header' => '业绩奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_YJ'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_YJ',
-                    ],
-                ],
-                'ORI_BONUS_YJ' => [
-                    'header' => '业绩奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_YJ'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_YJ',
-                    ],
-                ],
-                'BONUS_GX' => [
-                    'header' => '共享奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_GX'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_GX',
-                    ],
-                ],
-                'ORI_BONUS_GX' => [
-                    'header' => '共享奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_GX'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_GX',
-                    ],
-                ],
-                'BONUS_GL' => [
-                    'header' => '管理奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_GL'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_GL',
-                    ],
-                ],
-                'ORI_BONUS_GL' => [
-                    'header' => '管理奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_GL'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_GL',
-                    ],
-                ],
-                'BONUS_QY' => [
-                    'header' => '团队奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_QY'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_QY',
-                    ],
-                ],
-                'ORI_BONUS_QY' => [
-                    'header' => '团队奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_QY'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_QY',
-                    ],
-                ],
-                'ORI_BONUS_QY_BD' => [
-                    'header' => '报单团队奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_QY_BD'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_QY_BD',
-                    ],
-                ],
-                'BONUS_YC' => [
-                    'header' => '荣衔奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_YC'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_YC',
-                    ],
-                ],
-                'ORI_BONUS_YC' => [
-                    'header' => '荣衔奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_YC'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_YC',
-                    ],
-                ],
-                'BONUS_TOTAL' => [
-                    'header' => '总奖金',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_TOTAL'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_TOTAL',
-                    ],
-                ],
-                'BONUS_INCOME' => [
-                    'header' => '总收入',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_INCOME'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_INCOME',
-                    ],
-                ],
-                'ORI_BONUS_STANDARD' => [
-                    'header' => '团队成长奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_STANDARD'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_STANDARD',
-                    ],
-                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [
-                'LAST_USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
-                'LAST_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '会员姓名'],
-                'LAST_DEC_LV_NAME'=> ['isUserTable'=> false, 'name'=> '结算时会员级别', 'other'=> 'decLevel'],
-                'LAST_EMP_LV_NAME'=> ['isUserTable'=> false, 'name'=> '结算时会员聘级', 'other'=> 'empLevel'],
-                'LAST_MOBILE'=> ['isUserTable'=> false, 'name'=> '手机号'],
-                'LAST_PERIOD_AT'=> ['isUserTable'=> false, 'name'=> '加入期数'],
-                'LAST_CREATED_AT'=> ['isUserTable'=> false, 'name'=> '加入时间', 'other'=> 'date'],
-                'LAST_REC_USER_NAME'=> ['isUserTable'=> false, 'name'=> '开拓者编号'],
-                'LAST_REC_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '开拓者姓名'],
-                'LAST_CON_USER_NAME'=> ['isUserTable'=> false, 'name'=> '上级编号'],
-                'LAST_CON_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '上级姓名'],
-                'PV_1L'=> ['isUserTable'=> false, 'name'=> '一市场新增业绩'],
-                'SURPLUS_1L'=> ['isUserTable'=> false, 'name'=> '一市场结余业绩'],
-                'PV_2L'=> ['isUserTable'=> false, 'name'=> '二市场新增业绩'],
-                'SURPLUS_2L'=> ['isUserTable'=> false, 'name'=> '二市场结余业绩'],
-                'PV_3L'=> ['isUserTable'=> false, 'name'=> '三市场新增业绩'],
-                'SURPLUS_3L'=> ['isUserTable'=> false, 'name'=> '三市场结余业绩'],
-                'BONUS_BD'=> ['isUserTable'=> false, 'name'=> '服务奖'],
-                'BONUS_TG'=> ['isUserTable'=> false, 'name'=> '推广奖'],
-                'BONUS_XF'=> ['isUserTable'=> false, 'name'=> '消费奖'],
-                'BONUS_YJ'=> ['isUserTable'=> false, 'name'=> '业绩奖'],
-                'BONUS_GX'=> ['isUserTable'=> false, 'name'=> '共享奖'],
-                'BONUS_GL'=> ['isUserTable'=> false, 'name'=> '管理奖'],
-                'BONUS_QY'=> ['isUserTable'=> false, 'name'=> '团队奖'],
-                'BONUS_YC'=> ['isUserTable'=> false, 'name'=> '荣衔奖'],
-                'ORI_BONUS_STANDARD'=> ['isUserTable'=> false, 'name'=> '团队成长奖'],
-                'CALC_MONTH'=> ['isUserTable'=> false, 'name'=> '结算月'],
-            ];
-        }
-        return $this->filterTypes;
-    }
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\Cache;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\PerfOrder;
+use common\models\Period;
+use common\models\Region;
+use common\models\User as modelUser;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserPerf;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class OtherPeriodBonusList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '往期奖金列表';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $this->listData = CalcBonus::lists($this->condition, $this->params, [
+            //'select'=>'CB.*, UP.SURPLUS_1L AS UP_SURPLUS_1L, UP.SURPLUS_2L AS UP_SURPLUS_2L, UP.SURPLUS_3L AS UP_SURPLUS_3L,UI.CON_UID,UI.REC_UID',
+            'select'=>'CB.*,UI.CON_UID,UI.REC_UID',
+            'from' => CalcBonus::tableName().' AS CB',
+            'join' => [
+                //['LEFT JOIN', UserPerf::tableName() . ' AS UP', 'CB.USER_ID=UP.USER_ID'],
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CB.USER_ID=UI.USER_ID'],
+            ],
+            'yearMonth' => $yearMonth,
+            'orderBy' => 'CB.CREATED_AT DESC, CB.ID DESC',
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        unset($yearMonth);
+        if ($this->listData['list']) {
+            foreach ($this->listData['list'] as $key => $value) {
+                $this->listData['list'][$key]['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$value['LAST_DEC_LV']]['LEVEL_NAME'];
+                $this->listData['list'][$key]['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$value['LAST_EMP_LV']]['LEVEL_NAME'];
+                $this->listData['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_STATUS']]['label'];
+
+                $this->listData['list'][$key]['LAST_REC_USER_NAME'] = Info::getUserNameByUserId($value['REC_UID']);
+                $this->listData['list'][$key]['LAST_REC_REAL_NAME'] = Info::getUserRealNameByUserId($value['REC_UID']);
+                $this->listData['list'][$key]['LAST_CON_USER_NAME'] = Info::getUserNameByUserId($value['CON_UID']);
+                $this->listData['list'][$key]['LAST_CON_REAL_NAME'] = Info::getUserRealNameByUserId($value['CON_UID']);
+            }
+        }
+    }
+
+    /**
+     * 要展示和导出的所有字段
+     * @return array
+     */
+    public function getColumn(){
+        if(!$this->columns){
+            $this->columns = [
+                'ID' => null,
+                'PERIOD_NUM' => [
+                    'header' => '结算期数',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'', 'size' => 'small', 'class'=>'no-border'],
+                    ],
+                ],
+                'CALCULATED_AT' => [
+                    'header' => '结算时间',
+                    'value' => function($row) {
+                        return (new DateTime([
+                            'value' => $row['CALCULATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+                'LAST_USER_NAME' => [
+                    'header' => '会员编号',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border']
+                    ],
+                ],
+                'LAST_REAL_NAME' => [
+                    'header' => '会员姓名',
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border']
+                    ],
+                ],
+                'LAST_DEC_LV_NAME' => [
+                    'header' => '结算时会员级别',
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                ],
+                'LAST_EMP_LV_NAME' => [
+                    'header' => '最新聘级',
+                    'headerOther' => [
+                        'width' => '140',
+                    ],
+                ],
+                'LAST_MOBILE' => [
+                    'header' => '手机号码',
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                ],
+                'LAST_PERIOD_AT' => [
+                    'header' => '加入期数',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+                'LAST_CREATED_AT' => [
+                    'header' => '加入时间',
+                    'value' => function($row) {
+                        return (new DateTime([
+                            'value' => $row['LAST_CREATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+                'LAST_REC_USER_NAME' => [
+                    'header' => '开拓者编号',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'LAST_REC_REAL_NAME' => [
+                    'header' => '开拓者姓名',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+                'LAST_CON_USER_NAME' => [
+                    'header' => '上级编号',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'LAST_CON_REAL_NAME' => [
+                    'header' => '上级姓名',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+                'PV_1L' => [
+                    'header' => '一市场新增业绩',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_1L'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'PV_1L',
+                    ],
+                ],
+                'SURPLUS_1L' => [
+                    'header' => '一市场结余业绩',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['SURPLUS_1L'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'SURPLUS_1L',
+                    ],
+                ],
+                'PV_2L' => [
+                    'header' => '二市场新增业绩',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_2L'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'PV_2L',
+                    ],
+                ],
+                'SURPLUS_2L' => [
+                    'header' => '二市场结余业绩',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['SURPLUS_2L'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'SURPLUS_2L',
+                    ],
+                ],
+//                'UP_SURPLUS_2L' => [
+//                    'header' => '当前二市场结余业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['UP_SURPLUS_2L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'UP_SURPLUS_2L',
+//                    ],
+//                ],
+                'PV_3L' => [
+                    'header' => '三市场新增业绩',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_3L'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'PV_3L',
+                    ],
+                ],
+                'SURPLUS_3L' => [
+                    'header' => '三市场结余业绩',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['SURPLUS_3L'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'SURPLUS_3L',
+                    ],
+                ],
+//                'UP_SURPLUS_3L' => [
+//                    'header' => '当前三市场结余业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['UP_SURPLUS_3L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'UP_SURPLUS_3L',
+//                    ],
+//                ],
+                'BONUS_BD' => [
+                    'header' => '服务奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_BD'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_BD',
+                    ],
+                ],
+                'ORI_BONUS_BD' => [
+                    'header' => '服务奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_BD'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_BD',
+                    ],
+                ],
+                'BONUS_TG' => [
+                    'header' => '推广奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_TG'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_TG',
+                    ],
+                ],
+                'ORI_BONUS_TG' => [
+                    'header' => '推广奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_TG'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_TG',
+                    ],
+                ],
+                'BONUS_XF' => [
+                    'header' => '消费奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_XF'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_XF',
+                    ],
+                ],
+                'ORI_BONUS_XF' => [
+                    'header' => '消费奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_XF'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_XF',
+                    ],
+                ],
+                'BONUS_YJ' => [
+                    'header' => '业绩奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_YJ'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_YJ',
+                    ],
+                ],
+                'ORI_BONUS_YJ' => [
+                    'header' => '业绩奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_YJ'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_YJ',
+                    ],
+                ],
+                'BONUS_GX' => [
+                    'header' => '共享奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_GX'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_GX',
+                    ],
+                ],
+                'ORI_BONUS_GX' => [
+                    'header' => '共享奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_GX'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_GX',
+                    ],
+                ],
+                'BONUS_GL' => [
+                    'header' => '管理奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_GL'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_GL',
+                    ],
+                ],
+                'ORI_BONUS_GL' => [
+                    'header' => '管理奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_GL'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_GL',
+                    ],
+                ],
+                'BONUS_QY' => [
+                    'header' => '团队奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_QY'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_QY',
+                    ],
+                ],
+                'ORI_BONUS_QY' => [
+                    'header' => '团队奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_QY'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_QY',
+                    ],
+                ],
+                'ORI_BONUS_QY_BD' => [
+                    'header' => '报单团队奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_QY_BD'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_QY_BD',
+                    ],
+                ],
+                'BONUS_YC' => [
+                    'header' => '荣衔奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_YC'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_YC',
+                    ],
+                ],
+                'ORI_BONUS_YC' => [
+                    'header' => '荣衔奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_YC'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_YC',
+                    ],
+                ],
+                'BONUS_TOTAL' => [
+                    'header' => '总奖金',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_TOTAL'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_TOTAL',
+                    ],
+                ],
+                'BONUS_INCOME' => [
+                    'header' => '总收入',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_INCOME'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_INCOME',
+                    ],
+                ],
+                'ORI_BONUS_STANDARD' => [
+                    'header' => '团队成长奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_STANDARD'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_STANDARD',
+                    ],
+                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [
+                'LAST_USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
+                'LAST_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '会员姓名'],
+                'LAST_DEC_LV_NAME'=> ['isUserTable'=> false, 'name'=> '结算时会员级别', 'other'=> 'decLevel'],
+                'LAST_EMP_LV_NAME'=> ['isUserTable'=> false, 'name'=> '最新聘级', 'other'=> 'empLevel'],
+                'LAST_MOBILE'=> ['isUserTable'=> false, 'name'=> '手机号'],
+                'LAST_PERIOD_AT'=> ['isUserTable'=> false, 'name'=> '加入期数'],
+                'LAST_CREATED_AT'=> ['isUserTable'=> false, 'name'=> '加入时间', 'other'=> 'date'],
+                'LAST_REC_USER_NAME'=> ['isUserTable'=> false, 'name'=> '开拓者编号'],
+                'LAST_REC_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '开拓者姓名'],
+                'LAST_CON_USER_NAME'=> ['isUserTable'=> false, 'name'=> '上级编号'],
+                'LAST_CON_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '上级姓名'],
+                'PV_1L'=> ['isUserTable'=> false, 'name'=> '一市场新增业绩'],
+                'SURPLUS_1L'=> ['isUserTable'=> false, 'name'=> '一市场结余业绩'],
+                'PV_2L'=> ['isUserTable'=> false, 'name'=> '二市场新增业绩'],
+                'SURPLUS_2L'=> ['isUserTable'=> false, 'name'=> '二市场结余业绩'],
+                'PV_3L'=> ['isUserTable'=> false, 'name'=> '三市场新增业绩'],
+                'SURPLUS_3L'=> ['isUserTable'=> false, 'name'=> '三市场结余业绩'],
+                'BONUS_BD'=> ['isUserTable'=> false, 'name'=> '服务奖'],
+                'BONUS_TG'=> ['isUserTable'=> false, 'name'=> '推广奖'],
+                'BONUS_XF'=> ['isUserTable'=> false, 'name'=> '消费奖'],
+                'BONUS_YJ'=> ['isUserTable'=> false, 'name'=> '业绩奖'],
+                'BONUS_GX'=> ['isUserTable'=> false, 'name'=> '共享奖'],
+                'BONUS_GL'=> ['isUserTable'=> false, 'name'=> '管理奖'],
+                'BONUS_QY'=> ['isUserTable'=> false, 'name'=> '团队奖'],
+                'BONUS_YC'=> ['isUserTable'=> false, 'name'=> '荣衔奖'],
+                'ORI_BONUS_STANDARD'=> ['isUserTable'=> false, 'name'=> '团队成长奖'],
+                'CALC_MONTH'=> ['isUserTable'=> false, 'name'=> '结算月'],
+            ];
+        }
+        return $this->filterTypes;
+    }
 }

+ 228 - 228
backendApi/modules/v1/models/lists/bonus/PerfMonthList.php

@@ -1,229 +1,229 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use common\helpers\Cache;
-use common\helpers\user\Info;
-use common\models\PerfMonth;
-use common\models\User as modelUser;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\DataListInterface;
-use common\libs\dataList\column\DateTime;
-use common\models\UserInfo;
-use Yii;
-
-class PerfMonthList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '月业绩列表';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $data = PerfMonth::lists($this->condition, $this->params, [
-            'select'=>'PM.*, U.USER_NAME, U.REAL_NAME,RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,',
-            'from' => PerfMonth::tableName().' AS PM',
-            'join' => [
-                ['LEFT JOIN', modelUser::tableName() . ' AS U', 'PM.USER_ID=U.ID'],
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'PM.USER_ID=UI.USER_ID'],
-                ['LEFT JOIN', modelUser::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
-            ],
-            'orderBy' => 'PM.CREATED_AT DESC, PM.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 = [
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-                'USER_NAME' => [
-                    'header' => '会员编号',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-                'REAL_NAME' => [
-                    'header' => '会员姓名',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'REC_USER_NAME' => [
-                    'header' => '推荐人编号',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-                'REC_REAL_NAME' => [
-                    'header' => '推荐人姓名',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'LAST_DEC_LV_NAME' => [
-                    'header' => '结算时会员级别',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'LAST_EMP_LV_NAME' => [
-                    'header' => '结算时会员聘级',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'PV_PCS' => [
-                    'header' => '个人业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_PCS'],
-                        ]))->result();
-                    },
-                ],
-                'VIP_PV_1L_ZC' => [
-                    'header' => '一市场新增报单业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['VIP_PV_1L_ZC'],
-                        ]))->result();
-                    },
-                ],
-                'VIP_PV_2L_ZC' => [
-                    'header' => '二市场新增报单业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['VIP_PV_2L_ZC'],
-                        ]))->result();
-                    },
-                ],
-                'VIP_PV_3L_ZC' => [
-                    'header' => '三市场新增报单业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['VIP_PV_3L_ZC'],
-                        ]))->result();
-                    },
-                ],
-                'VIP_SURPLUS_1L_ZC' => [
-                    'header' => '一市场月剩余报单业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['VIP_SURPLUS_1L_ZC'],
-                        ]))->result();
-                    },
-                ],
-                'VIP_SURPLUS_2L_ZC' => [
-                    'header' => '二市场月剩余报单业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['VIP_SURPLUS_2L_ZC'],
-                        ]))->result();
-                    },
-                ],
-                'VIP_SURPLUS_3L_ZC' => [
-                    'header' => '三市场月剩余报单业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['VIP_SURPLUS_3L_ZC'],
-                        ]))->result();
-                    },
-                ],
-                'PV_PSS' => [
-                    'header' => '月新增团队业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_PSS'],
-                        ]))->result();
-                    },
-                ],
-                'PV_PSS_TOTAL' => [
-                    'header' => '月累计团队业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_PSS_TOTAL'],
-                        ]))->result();
-                    },
-                ],
-                '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 = [
-                'CALC_MONTH'=> ['isUserTable'=> false, 'name'=> '结算月'],
-                'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
-                'REC_USER_NAME'=> ['isUserTable'=> false, 'name'=> '推荐人编号'],
-                'CREATED_AT'=> ['isUserTable'=> false, 'name'=> '创建时间', 'other'=> 'date'],
-            ];
-        }
-        return $this->filterTypes;
-    }
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use common\helpers\Cache;
+use common\helpers\user\Info;
+use common\models\PerfMonth;
+use common\models\User as modelUser;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\DataListInterface;
+use common\libs\dataList\column\DateTime;
+use common\models\UserInfo;
+use Yii;
+
+class PerfMonthList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '月业绩列表';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $data = PerfMonth::lists($this->condition, $this->params, [
+            'select'=>'PM.*, U.USER_NAME, U.REAL_NAME,RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,',
+            'from' => PerfMonth::tableName().' AS PM',
+            'join' => [
+                ['LEFT JOIN', modelUser::tableName() . ' AS U', 'PM.USER_ID=U.ID'],
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'PM.USER_ID=UI.USER_ID'],
+                ['LEFT JOIN', modelUser::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
+            ],
+            'orderBy' => 'PM.CREATED_AT DESC, PM.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 = [
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+                'USER_NAME' => [
+                    'header' => '会员编号',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+                'REAL_NAME' => [
+                    'header' => '会员姓名',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'REC_USER_NAME' => [
+                    'header' => '推荐人编号',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+                'REC_REAL_NAME' => [
+                    'header' => '推荐人姓名',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'LAST_DEC_LV_NAME' => [
+                    'header' => '结算时会员级别',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'LAST_EMP_LV_NAME' => [
+                    'header' => '最新聘级',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'PV_PCS' => [
+                    'header' => '个人业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_PCS'],
+                        ]))->result();
+                    },
+                ],
+                'VIP_PV_1L_ZC' => [
+                    'header' => '一市场新增报单业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['VIP_PV_1L_ZC'],
+                        ]))->result();
+                    },
+                ],
+                'VIP_PV_2L_ZC' => [
+                    'header' => '二市场新增报单业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['VIP_PV_2L_ZC'],
+                        ]))->result();
+                    },
+                ],
+                'VIP_PV_3L_ZC' => [
+                    'header' => '三市场新增报单业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['VIP_PV_3L_ZC'],
+                        ]))->result();
+                    },
+                ],
+                'VIP_SURPLUS_1L_ZC' => [
+                    'header' => '一市场月剩余报单业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['VIP_SURPLUS_1L_ZC'],
+                        ]))->result();
+                    },
+                ],
+                'VIP_SURPLUS_2L_ZC' => [
+                    'header' => '二市场月剩余报单业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['VIP_SURPLUS_2L_ZC'],
+                        ]))->result();
+                    },
+                ],
+                'VIP_SURPLUS_3L_ZC' => [
+                    'header' => '三市场月剩余报单业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['VIP_SURPLUS_3L_ZC'],
+                        ]))->result();
+                    },
+                ],
+                'PV_PSS' => [
+                    'header' => '月新增团队业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_PSS'],
+                        ]))->result();
+                    },
+                ],
+                'PV_PSS_TOTAL' => [
+                    'header' => '月累计团队业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_PSS_TOTAL'],
+                        ]))->result();
+                    },
+                ],
+                '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 = [
+                'CALC_MONTH'=> ['isUserTable'=> false, 'name'=> '结算月'],
+                'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
+                'REC_USER_NAME'=> ['isUserTable'=> false, 'name'=> '推荐人编号'],
+                'CREATED_AT'=> ['isUserTable'=> false, 'name'=> '创建时间', 'other'=> 'date'],
+            ];
+        }
+        return $this->filterTypes;
+    }
 }

+ 152 - 152
backendApi/modules/v1/models/lists/bonus/PerfStandardList.php

@@ -1,153 +1,153 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use common\helpers\Cache;
-use common\helpers\user\Info;
-use common\models\PerfMonth;
-use common\models\PerfStandard;
-use common\models\User as modelUser;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\DataListInterface;
-use common\libs\dataList\column\DateTime;
-use common\models\UserInfo;
-use Yii;
-
-class PerfStandardList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '达标业绩列表';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $data = PerfStandard::lists($this->condition, $this->params, [
-            'select'=>'PS.*, U.USER_NAME, U.REAL_NAME,RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,',
-            'from' => PerfStandard::tableName().' AS PS',
-            'join' => [
-                ['LEFT JOIN', modelUser::tableName() . ' AS U', 'PS.USER_ID=U.ID'],
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'PS.USER_ID=UI.USER_ID'],
-                ['LEFT JOIN', modelUser::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
-            ],
-            'orderBy' => 'PS.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 = [
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-                'USER_NAME' => [
-                    'header' => '会员编号',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-                'REAL_NAME' => [
-                    'header' => '会员姓名',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'REC_USER_NAME' => [
-                    'header' => '推荐人编号',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-                'REC_REAL_NAME' => [
-                    'header' => '推荐人姓名',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'LAST_DEC_LV_NAME' => [
-                    'header' => '结算时会员级别',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'LAST_EMP_LV_NAME' => [
-                    'header' => '结算时会员聘级',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'AMOUNT_PCS' => [
-                    'header' => '个人销售额',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['AMOUNT_PCS'],
-                        ]))->result();
-                    },
-                ],
-                'AMOUNT_PSS' => [
-                    'header' => '团队销售额',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['AMOUNT_PSS'],
-                        ]))->result();
-                    },
-                ],
-                '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 = [
-                'CALC_MONTH'=> ['isUserTable'=> false, 'name'=> '结算月'],
-                'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
-                'REC_USER_NAME'=> ['isUserTable'=> false, 'name'=> '推荐人编号'],
-                'CREATED_AT'=> ['isUserTable'=> false, 'name'=> '创建时间', 'other'=> 'date'],
-            ];
-        }
-        return $this->filterTypes;
-    }
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use common\helpers\Cache;
+use common\helpers\user\Info;
+use common\models\PerfMonth;
+use common\models\PerfStandard;
+use common\models\User as modelUser;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\DataListInterface;
+use common\libs\dataList\column\DateTime;
+use common\models\UserInfo;
+use Yii;
+
+class PerfStandardList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '达标业绩列表';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $data = PerfStandard::lists($this->condition, $this->params, [
+            'select'=>'PS.*, U.USER_NAME, U.REAL_NAME,RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,',
+            'from' => PerfStandard::tableName().' AS PS',
+            'join' => [
+                ['LEFT JOIN', modelUser::tableName() . ' AS U', 'PS.USER_ID=U.ID'],
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'PS.USER_ID=UI.USER_ID'],
+                ['LEFT JOIN', modelUser::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
+            ],
+            'orderBy' => 'PS.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 = [
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+                'USER_NAME' => [
+                    'header' => '会员编号',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+                'REAL_NAME' => [
+                    'header' => '会员姓名',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'REC_USER_NAME' => [
+                    'header' => '推荐人编号',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+                'REC_REAL_NAME' => [
+                    'header' => '推荐人姓名',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'LAST_DEC_LV_NAME' => [
+                    'header' => '结算时会员级别',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'LAST_EMP_LV_NAME' => [
+                    'header' => '最新聘级',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'AMOUNT_PCS' => [
+                    'header' => '个人销售额',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['AMOUNT_PCS'],
+                        ]))->result();
+                    },
+                ],
+                'AMOUNT_PSS' => [
+                    'header' => '团队销售额',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['AMOUNT_PSS'],
+                        ]))->result();
+                    },
+                ],
+                '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 = [
+                'CALC_MONTH'=> ['isUserTable'=> false, 'name'=> '结算月'],
+                'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
+                'REC_USER_NAME'=> ['isUserTable'=> false, 'name'=> '推荐人编号'],
+                'CREATED_AT'=> ['isUserTable'=> false, 'name'=> '创建时间', 'other'=> 'date'],
+            ];
+        }
+        return $this->filterTypes;
+    }
 }

+ 713 - 713
backendApi/modules/v1/models/lists/bonus/PeriodBonusList.php

@@ -1,714 +1,714 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\Cache;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\PerfOrder;
-use common\models\Period;
-use common\models\Region;
-use common\models\User as modelUser;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserPerf;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class PeriodBonusList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '奖金列表';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $this->listData = CalcBonus::lists($this->condition, $this->params, [
-//            'select'=>'CB.*, UP.SURPLUS_1L AS UP_SURPLUS_1L, UP.SURPLUS_2L AS UP_SURPLUS_2L, UP.SURPLUS_3L AS UP_SURPLUS_3L,UI.CON_UID,UI.REC_UID',
-            'select'=>'CB.*,UI.CON_UID,UI.REC_UID',
-            'from' => CalcBonus::tableName().' AS CB',
-            'join' => [
-//                ['LEFT JOIN', UserPerf::tableName() . ' AS UP', 'CB.USER_ID=UP.USER_ID'],
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CB.USER_ID=UI.USER_ID'],
-            ],
-            'yearMonth' => $yearMonth,
-            'orderBy' => 'CB.CREATED_AT DESC, CB.ID DESC',
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        unset($yearMonth);
-        if ($this->listData['list']) {
-            foreach ($this->listData['list'] as $key => $value) {
-                $this->listData['list'][$key]['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$value['LAST_DEC_LV']]['LEVEL_NAME'];
-                $this->listData['list'][$key]['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$value['LAST_EMP_LV']]['LEVEL_NAME'];
-                $this->listData['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_STATUS']]['label'];
-
-                $this->listData['list'][$key]['LAST_REC_USER_NAME'] = Info::getUserNameByUserId($value['REC_UID']);
-                $this->listData['list'][$key]['LAST_REC_REAL_NAME'] = Info::getUserRealNameByUserId($value['REC_UID']);
-                $this->listData['list'][$key]['LAST_CON_USER_NAME'] = Info::getUserNameByUserId($value['CON_UID']);
-                $this->listData['list'][$key]['LAST_CON_REAL_NAME'] = Info::getUserRealNameByUserId($value['CON_UID']);
-            }
-        }
-    }
-
-    /**
-     * 要展示和导出的所有字段
-     * @return array
-     */
-    public function getColumn(){
-        if(!$this->columns){
-            $this->columns = [
-                'ID' => null,
-                'PERIOD_NUM' => [
-                    'header' => '结算期数',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'', 'size' => 'small', 'class'=>'no-border'],
-                    ],
-                ],
-                'CALCULATED_AT' => [
-                    'header' => '结算时间',
-                    'value' => function($row) {
-                        return (new DateTime([
-                            'value' => $row['CALCULATED_AT'],
-                        ]))->result();
-                    },
-                    'headerOther' => ['width' => '170'],
-                ],
-                'LAST_USER_NAME' => [
-                    'header' => '会员编号',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border']
-                    ],
-                ],
-                'LAST_REAL_NAME' => [
-                    'header' => '会员姓名',
-                    'headerOther' => [
-                        'width' => '120',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border']
-                    ],
-                ],
-                'LAST_DEC_LV_NAME' => [
-                    'header' => '结算时会员级别',
-                    'headerOther' => [
-                        'width' => '120',
-                    ],
-                ],
-                'LAST_EMP_LV_NAME' => [
-                    'header' => '结算时会员聘级',
-                    'headerOther' => [
-                        'width' => '140',
-                    ],
-                ],
-                'LAST_MOBILE' => [
-                    'header' => '手机号码',
-                    'headerOther' => [
-                        'width' => '120',
-                    ],
-                ],
-                'LAST_PERIOD_AT' => [
-                    'header' => '加入期数',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-                'LAST_CREATED_AT' => [
-                    'header' => '加入时间',
-                    'value' => function($row) {
-                        return (new DateTime([
-                            'value' => $row['LAST_CREATED_AT'],
-                        ]))->result();
-                    },
-                    'headerOther' => ['width' => '170'],
-                ],
-                'LAST_REC_USER_NAME' => [
-                    'header' => '开拓者编号',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'LAST_REC_REAL_NAME' => [
-                    'header' => '开拓者姓名',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-                'LAST_CON_USER_NAME' => [
-                    'header' => '上级编号',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'LAST_CON_REAL_NAME' => [
-                    'header' => '上级姓名',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-//                'PV_1L' => [
-//                    'header' => '一市场新增业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['PV_1L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'PV_1L',
-//                    ],
-//                ],
-//                'SURPLUS_1L' => [
-//                    'header' => '一市场结余业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['SURPLUS_1L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'SURPLUS_1L',
-//                    ],
-//                ],
-//                'UP_SURPLUS_1L' => [
-//                    'header' => '当前一市场结余业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['UP_SURPLUS_1L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'UP_SURPLUS_1L',
-//                    ],
-//                ],
-//                'PV_2L' => [
-//                    'header' => '二市场新增业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['PV_2L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'PV_2L',
-//                    ],
-//                ],
-//                'SURPLUS_2L' => [
-//                    'header' => '二市场结余业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['SURPLUS_2L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'SURPLUS_2L',
-//                    ],
-//                ],
-//                'UP_SURPLUS_2L' => [
-//                    'header' => '当前二市场结余业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['UP_SURPLUS_2L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'UP_SURPLUS_2L',
-//                    ],
-//                ],
-//                'PV_3L' => [
-//                    'header' => '三市场新增业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['PV_3L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'PV_3L',
-//                    ],
-//                ],
-//                'SURPLUS_3L' => [
-//                    'header' => '三市场结余业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['SURPLUS_3L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'SURPLUS_3L',
-//                    ],
-//                ],
-//                'UP_SURPLUS_3L' => [
-//                    'header' => '当前三市场结余业绩',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['UP_SURPLUS_3L'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'UP_SURPLUS_3L',
-//                    ],
-//                ],
-                'BONUS_TG' => [
-                    'header' => '推广奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_TG'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_TG',
-                    ],
-                ],
-                'ORI_BONUS_TG' => [
-                    'header' => '推广奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_TG'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_TG',
-                    ],
-                ],
-                'BONUS_QY' => [
-                    'header' => '团队奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_QY'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_QY',
-                    ],
-                ],
-                'ORI_BONUS_QY' => [
-                    'header' => '团队奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_QY'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_QY',
-                    ],
-                ],
-                'ORI_BONUS_QY_BD' => [
-                    'header' => '报单团队奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_QY_BD'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_QY_BD',
-                    ],
-                ],
-                'BONUS_BS' => [
-                    'header' => '蓝星管理奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_BS'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_BS',
-                    ],
-                ],
-                'ORI_BONUS_BS' => [
-                    'header' => '蓝星管理奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_BS'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_BS',
-                    ],
-                ],
-                // 'REAL_BONUS_BS' => [
-                //     'header' => '实发蓝星管理奖',
-                //     'value' => function($row) {
-                //         return (new Price([
-                //             'value' => $row['REAL_BONUS_BS'],
-                //         ]))->result();
-                //     },
-                //     'headerOther' => [
-                //         'width' => '120',
-                //         'prop'=>'REAL_BONUS_BS',
-                //     ],
-                // ],
-                'BONUS_GX' => [
-                    'header' => '共享奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_GX'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_GX',
-                    ],
-                ],
-                'ORI_BONUS_GX' => [
-                    'header' => '共享奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_GX'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_GX',
-                    ],
-                ],
-                'REAL_BONUS_GX' => [
-                    'header' => '实发共享奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['REAL_BONUS_GX'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'REAL_BONUS_GX',
-                    ],
-                ],
-                'BONUS_BD' => [
-                    'header' => '服务奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_BD'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_BD',
-                    ],
-                ],
-                'ORI_BONUS_BD' => [
-                    'header' => '服务奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_BD'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_BD',
-                    ],
-                ],
-                'BONUS_REAL' => [
-                    'header' => '实发奖金',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_REAL'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_REAL',
-                    ],
-                ],
-                'BONUS_TOTAL' => [
-                    'header' => '总奖金',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_TOTAL'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_TOTAL',
-                    ],
-                ],
-                'MANAGE_TAX' => [
-                    'header' => '管理费',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['MANAGE_TAX'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'MANAGE_TAX',
-                    ],
-                ],
-                'RECONSUME_POINTS' => [
-                    'header' => '复销积分',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['RECONSUME_POINTS'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'RECONSUME_POINTS',
-                    ],
-                ],
-                'BONUS_INCOME' => [
-                    'header' => '总收入',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_INCOME'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_INCOME',
-                    ],
-                ],
-                'ORI_BONUS_STANDARD' => [
-                    'header' => '团队成长奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_STANDARD'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_STANDARD',
-                    ],
-                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-                'BONUS_XF' => [
-                    'header' => '消费奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_XF'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_XF',
-                    ],
-                ],
-                'ORI_BONUS_XF' => [
-                    'header' => '消费奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_XF'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_XF',
-                    ],
-                ],
-                'BONUS_YJ' => [
-                    'header' => '业绩奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_YJ'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_YJ',
-                    ],
-                ],
-                'ORI_BONUS_YJ' => [
-                    'header' => '业绩奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_YJ'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_YJ',
-                    ],
-                ],
-                'BONUS_YC' => [
-                    'header' => '荣衔奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_YC'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_YC',
-                    ],
-                ],
-                'ORI_BONUS_YC' => [
-                    'header' => '荣衔奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_YC'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_YC',
-                    ],
-                ],
-                'BONUS_VIP' => [
-                    'header' => 'VIP奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_VIP'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_VIP',
-                    ],
-                ],
-                'ORI_BONUS_VIP' => [
-                    'header' => 'VIP奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_VIP'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_VIP',
-                    ],
-                ],
-                'BONUS_GL' => [
-                    'header' => '管理奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS_GL'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'BONUS_GL',
-                    ],
-                ],
-                'ORI_BONUS_GL' => [
-                    'header' => '管理奖原金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['ORI_BONUS_GL'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'ORI_BONUS_GL',
-                    ],
-                ],
-                'REAL_BONUS_GL' => [
-                    'header' => '实发管理奖',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['REAL_BONUS_GL'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '120',
-                        'prop'=>'REAL_BONUS_GL',
-                    ],
-                ],
-//                'BONUS_FW' => [
-//                    'header' => '服务奖',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['BONUS_FW'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'BONUS_FW',
-//                    ],
-//                ],
-//                'ORI_BONUS_FW' => [
-//                    'header' => '服务奖原金额',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['ORI_BONUS_FW'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '120',
-//                        'prop'=>'ORI_BONUS_FW',
-//                    ],
-//                ],
-                
-                
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [
-                'LAST_USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
-                'LAST_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '会员姓名'],
-                'LAST_DEC_LV_NAME'=> ['isUserTable'=> false, 'name'=> '结算时会员级别', 'other'=> 'decLevel'],
-                'LAST_EMP_LV_NAME'=> ['isUserTable'=> false, 'name'=> '结算时会员聘级', 'other'=> 'empLevel'],
-                'LAST_MOBILE'=> ['isUserTable'=> false, 'name'=> '手机号'],
-                'LAST_PERIOD_AT'=> ['isUserTable'=> false, 'name'=> '加入期数'],
-                'LAST_CREATED_AT'=> ['isUserTable'=> false, 'name'=> '加入时间', 'other'=> 'date'],
-                'LAST_REC_USER_NAME'=> ['isUserTable'=> false, 'name'=> '开拓者编号'],
-                'LAST_REC_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '开拓者姓名'],
-                'LAST_CON_USER_NAME'=> ['isUserTable'=> false, 'name'=> '上级编号'],
-                'LAST_CON_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '上级姓名'],
-                'PV_1L'=> ['isUserTable'=> false, 'name'=> '一市场新增业绩'],
-                'SURPLUS_1L'=> ['isUserTable'=> false, 'name'=> '一市场结余业绩'],
-                'PV_2L'=> ['isUserTable'=> false, 'name'=> '二市场新增业绩'],
-                'SURPLUS_2L'=> ['isUserTable'=> false, 'name'=> '二市场结余业绩'],
-                'PV_3L'=> ['isUserTable'=> false, 'name'=> '三市场新增业绩'],
-                'SURPLUS_3L'=> ['isUserTable'=> false, 'name'=> '三市场结余业绩'],
-                'BONUS_BD'=> ['isUserTable'=> false, 'name'=> '服务奖'],
-                'BONUS_TG'=> ['isUserTable'=> false, 'name'=> '推广奖'],
-                'BONUS_XF'=> ['isUserTable'=> false, 'name'=> '消费奖'],
-                'BONUS_YJ'=> ['isUserTable'=> false, 'name'=> '业绩奖'],
-                'BONUS_GX'=> ['isUserTable'=> false, 'name'=> '共享奖'],
-                'BONUS_GL'=> ['isUserTable'=> false, 'name'=> '管理奖'],
-                'BONUS_QY'=> ['isUserTable'=> false, 'name'=> '团队奖'],
-                'BONUS_YC'=> ['isUserTable'=> false, 'name'=> '荣衔奖'],
-                'ORI_BONUS_STANDARD'=> ['isUserTable'=> false, 'name'=> '团队成长奖'],
-                'CALC_MONTH'=> ['isUserTable'=> false, 'name'=> '结算月'],
-            ];
-        }
-        return $this->filterTypes;
-    }
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\Cache;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\PerfOrder;
+use common\models\Period;
+use common\models\Region;
+use common\models\User as modelUser;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserPerf;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class PeriodBonusList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '奖金列表';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $this->listData = CalcBonus::lists($this->condition, $this->params, [
+//            'select'=>'CB.*, UP.SURPLUS_1L AS UP_SURPLUS_1L, UP.SURPLUS_2L AS UP_SURPLUS_2L, UP.SURPLUS_3L AS UP_SURPLUS_3L,UI.CON_UID,UI.REC_UID',
+            'select'=>'CB.*,UI.CON_UID,UI.REC_UID',
+            'from' => CalcBonus::tableName().' AS CB',
+            'join' => [
+//                ['LEFT JOIN', UserPerf::tableName() . ' AS UP', 'CB.USER_ID=UP.USER_ID'],
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CB.USER_ID=UI.USER_ID'],
+            ],
+            'yearMonth' => $yearMonth,
+            'orderBy' => 'CB.CREATED_AT DESC, CB.ID DESC',
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        unset($yearMonth);
+        if ($this->listData['list']) {
+            foreach ($this->listData['list'] as $key => $value) {
+                $this->listData['list'][$key]['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$value['LAST_DEC_LV']]['LEVEL_NAME'];
+                $this->listData['list'][$key]['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$value['LAST_EMP_LV']]['LEVEL_NAME'];
+                $this->listData['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_STATUS']]['label'];
+
+                $this->listData['list'][$key]['LAST_REC_USER_NAME'] = Info::getUserNameByUserId($value['REC_UID']);
+                $this->listData['list'][$key]['LAST_REC_REAL_NAME'] = Info::getUserRealNameByUserId($value['REC_UID']);
+                $this->listData['list'][$key]['LAST_CON_USER_NAME'] = Info::getUserNameByUserId($value['CON_UID']);
+                $this->listData['list'][$key]['LAST_CON_REAL_NAME'] = Info::getUserRealNameByUserId($value['CON_UID']);
+            }
+        }
+    }
+
+    /**
+     * 要展示和导出的所有字段
+     * @return array
+     */
+    public function getColumn(){
+        if(!$this->columns){
+            $this->columns = [
+                'ID' => null,
+                'PERIOD_NUM' => [
+                    'header' => '结算期数',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'', 'size' => 'small', 'class'=>'no-border'],
+                    ],
+                ],
+                'CALCULATED_AT' => [
+                    'header' => '结算时间',
+                    'value' => function($row) {
+                        return (new DateTime([
+                            'value' => $row['CALCULATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+                'LAST_USER_NAME' => [
+                    'header' => '会员编号',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border']
+                    ],
+                ],
+                'LAST_REAL_NAME' => [
+                    'header' => '会员姓名',
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border']
+                    ],
+                ],
+                'LAST_DEC_LV_NAME' => [
+                    'header' => '结算时会员级别',
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                ],
+                'LAST_EMP_LV_NAME' => [
+                    'header' => '最新聘级',
+                    'headerOther' => [
+                        'width' => '140',
+                    ],
+                ],
+                'LAST_MOBILE' => [
+                    'header' => '手机号码',
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                ],
+                'LAST_PERIOD_AT' => [
+                    'header' => '加入期数',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+                'LAST_CREATED_AT' => [
+                    'header' => '加入时间',
+                    'value' => function($row) {
+                        return (new DateTime([
+                            'value' => $row['LAST_CREATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+                'LAST_REC_USER_NAME' => [
+                    'header' => '开拓者编号',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'LAST_REC_REAL_NAME' => [
+                    'header' => '开拓者姓名',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+                'LAST_CON_USER_NAME' => [
+                    'header' => '上级编号',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'LAST_CON_REAL_NAME' => [
+                    'header' => '上级姓名',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+//                'PV_1L' => [
+//                    'header' => '一市场新增业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['PV_1L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'PV_1L',
+//                    ],
+//                ],
+//                'SURPLUS_1L' => [
+//                    'header' => '一市场结余业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['SURPLUS_1L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'SURPLUS_1L',
+//                    ],
+//                ],
+//                'UP_SURPLUS_1L' => [
+//                    'header' => '当前一市场结余业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['UP_SURPLUS_1L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'UP_SURPLUS_1L',
+//                    ],
+//                ],
+//                'PV_2L' => [
+//                    'header' => '二市场新增业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['PV_2L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'PV_2L',
+//                    ],
+//                ],
+//                'SURPLUS_2L' => [
+//                    'header' => '二市场结余业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['SURPLUS_2L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'SURPLUS_2L',
+//                    ],
+//                ],
+//                'UP_SURPLUS_2L' => [
+//                    'header' => '当前二市场结余业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['UP_SURPLUS_2L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'UP_SURPLUS_2L',
+//                    ],
+//                ],
+//                'PV_3L' => [
+//                    'header' => '三市场新增业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['PV_3L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'PV_3L',
+//                    ],
+//                ],
+//                'SURPLUS_3L' => [
+//                    'header' => '三市场结余业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['SURPLUS_3L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'SURPLUS_3L',
+//                    ],
+//                ],
+//                'UP_SURPLUS_3L' => [
+//                    'header' => '当前三市场结余业绩',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['UP_SURPLUS_3L'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'UP_SURPLUS_3L',
+//                    ],
+//                ],
+                'BONUS_TG' => [
+                    'header' => '推广奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_TG'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_TG',
+                    ],
+                ],
+                'ORI_BONUS_TG' => [
+                    'header' => '推广奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_TG'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_TG',
+                    ],
+                ],
+                'BONUS_QY' => [
+                    'header' => '团队奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_QY'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_QY',
+                    ],
+                ],
+                'ORI_BONUS_QY' => [
+                    'header' => '团队奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_QY'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_QY',
+                    ],
+                ],
+                'ORI_BONUS_QY_BD' => [
+                    'header' => '报单团队奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_QY_BD'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_QY_BD',
+                    ],
+                ],
+                'BONUS_BS' => [
+                    'header' => '蓝星管理奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_BS'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_BS',
+                    ],
+                ],
+                'ORI_BONUS_BS' => [
+                    'header' => '蓝星管理奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_BS'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_BS',
+                    ],
+                ],
+                // 'REAL_BONUS_BS' => [
+                //     'header' => '实发蓝星管理奖',
+                //     'value' => function($row) {
+                //         return (new Price([
+                //             'value' => $row['REAL_BONUS_BS'],
+                //         ]))->result();
+                //     },
+                //     'headerOther' => [
+                //         'width' => '120',
+                //         'prop'=>'REAL_BONUS_BS',
+                //     ],
+                // ],
+                'BONUS_GX' => [
+                    'header' => '共享奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_GX'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_GX',
+                    ],
+                ],
+                'ORI_BONUS_GX' => [
+                    'header' => '共享奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_GX'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_GX',
+                    ],
+                ],
+                'REAL_BONUS_GX' => [
+                    'header' => '实发共享奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['REAL_BONUS_GX'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'REAL_BONUS_GX',
+                    ],
+                ],
+                'BONUS_BD' => [
+                    'header' => '服务奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_BD'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_BD',
+                    ],
+                ],
+                'ORI_BONUS_BD' => [
+                    'header' => '服务奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_BD'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_BD',
+                    ],
+                ],
+                'BONUS_REAL' => [
+                    'header' => '实发奖金',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_REAL'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_REAL',
+                    ],
+                ],
+                'BONUS_TOTAL' => [
+                    'header' => '总奖金',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_TOTAL'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_TOTAL',
+                    ],
+                ],
+                'MANAGE_TAX' => [
+                    'header' => '管理费',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['MANAGE_TAX'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'MANAGE_TAX',
+                    ],
+                ],
+                'RECONSUME_POINTS' => [
+                    'header' => '复销积分',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['RECONSUME_POINTS'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'RECONSUME_POINTS',
+                    ],
+                ],
+                'BONUS_INCOME' => [
+                    'header' => '总收入',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_INCOME'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_INCOME',
+                    ],
+                ],
+                'ORI_BONUS_STANDARD' => [
+                    'header' => '团队成长奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_STANDARD'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_STANDARD',
+                    ],
+                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+                'BONUS_XF' => [
+                    'header' => '消费奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_XF'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_XF',
+                    ],
+                ],
+                'ORI_BONUS_XF' => [
+                    'header' => '消费奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_XF'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_XF',
+                    ],
+                ],
+                'BONUS_YJ' => [
+                    'header' => '业绩奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_YJ'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_YJ',
+                    ],
+                ],
+                'ORI_BONUS_YJ' => [
+                    'header' => '业绩奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_YJ'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_YJ',
+                    ],
+                ],
+                'BONUS_YC' => [
+                    'header' => '荣衔奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_YC'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_YC',
+                    ],
+                ],
+                'ORI_BONUS_YC' => [
+                    'header' => '荣衔奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_YC'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_YC',
+                    ],
+                ],
+                'BONUS_VIP' => [
+                    'header' => 'VIP奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_VIP'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_VIP',
+                    ],
+                ],
+                'ORI_BONUS_VIP' => [
+                    'header' => 'VIP奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_VIP'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_VIP',
+                    ],
+                ],
+                'BONUS_GL' => [
+                    'header' => '管理奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS_GL'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'BONUS_GL',
+                    ],
+                ],
+                'ORI_BONUS_GL' => [
+                    'header' => '管理奖原金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['ORI_BONUS_GL'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'ORI_BONUS_GL',
+                    ],
+                ],
+                'REAL_BONUS_GL' => [
+                    'header' => '实发管理奖',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['REAL_BONUS_GL'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '120',
+                        'prop'=>'REAL_BONUS_GL',
+                    ],
+                ],
+//                'BONUS_FW' => [
+//                    'header' => '服务奖',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['BONUS_FW'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'BONUS_FW',
+//                    ],
+//                ],
+//                'ORI_BONUS_FW' => [
+//                    'header' => '服务奖原金额',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['ORI_BONUS_FW'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '120',
+//                        'prop'=>'ORI_BONUS_FW',
+//                    ],
+//                ],
+                
+                
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [
+                'LAST_USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
+                'LAST_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '会员姓名'],
+                'LAST_DEC_LV_NAME'=> ['isUserTable'=> false, 'name'=> '结算时会员级别', 'other'=> 'decLevel'],
+                'LAST_EMP_LV_NAME'=> ['isUserTable'=> false, 'name'=> '最新聘级', 'other'=> 'empLevel'],
+                'LAST_MOBILE'=> ['isUserTable'=> false, 'name'=> '手机号'],
+                'LAST_PERIOD_AT'=> ['isUserTable'=> false, 'name'=> '加入期数'],
+                'LAST_CREATED_AT'=> ['isUserTable'=> false, 'name'=> '加入时间', 'other'=> 'date'],
+                'LAST_REC_USER_NAME'=> ['isUserTable'=> false, 'name'=> '开拓者编号'],
+                'LAST_REC_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '开拓者姓名'],
+                'LAST_CON_USER_NAME'=> ['isUserTable'=> false, 'name'=> '上级编号'],
+                'LAST_CON_REAL_NAME'=> ['isUserTable'=> false, 'name'=> '上级姓名'],
+                'PV_1L'=> ['isUserTable'=> false, 'name'=> '一市场新增业绩'],
+                'SURPLUS_1L'=> ['isUserTable'=> false, 'name'=> '一市场结余业绩'],
+                'PV_2L'=> ['isUserTable'=> false, 'name'=> '二市场新增业绩'],
+                'SURPLUS_2L'=> ['isUserTable'=> false, 'name'=> '二市场结余业绩'],
+                'PV_3L'=> ['isUserTable'=> false, 'name'=> '三市场新增业绩'],
+                'SURPLUS_3L'=> ['isUserTable'=> false, 'name'=> '三市场结余业绩'],
+                'BONUS_BD'=> ['isUserTable'=> false, 'name'=> '服务奖'],
+                'BONUS_TG'=> ['isUserTable'=> false, 'name'=> '推广奖'],
+                'BONUS_XF'=> ['isUserTable'=> false, 'name'=> '消费奖'],
+                'BONUS_YJ'=> ['isUserTable'=> false, 'name'=> '业绩奖'],
+                'BONUS_GX'=> ['isUserTable'=> false, 'name'=> '共享奖'],
+                'BONUS_GL'=> ['isUserTable'=> false, 'name'=> '管理奖'],
+                'BONUS_QY'=> ['isUserTable'=> false, 'name'=> '团队奖'],
+                'BONUS_YC'=> ['isUserTable'=> false, 'name'=> '荣衔奖'],
+                'ORI_BONUS_STANDARD'=> ['isUserTable'=> false, 'name'=> '团队成长奖'],
+                'CALC_MONTH'=> ['isUserTable'=> false, 'name'=> '结算月'],
+            ];
+        }
+        return $this->filterTypes;
+    }
 }

+ 135 - 135
backendApi/modules/v1/models/lists/bonus/PeriodPerfList.php

@@ -1,136 +1,136 @@
-<?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 PeriodPerfList 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'=>'PM.*, U.USER_NAME, U.REAL_NAME',
-            'from' => PerfPeriod::tableName().' AS PM',
-            'join' => [
-                ['LEFT JOIN', modelUser::tableName() . ' AS U', 'PM.USER_ID=U.ID'],
-            ],
-            'orderBy' => 'PM.CREATED_AT DESC, PM.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' => '期数',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-                'USER_NAME' => [
-                    'header' => '会员编号',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-                'REAL_NAME' => [
-                    'header' => '会员姓名',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'LAST_DEC_LV_NAME' => [
-                    'header' => '结算时会员级别',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'LAST_EMP_LV_NAME' => [
-                    'header' => '结算时会员聘级',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'PV_PCS' => [
-                    'header' => '个人业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_PCS'],
-                        ]))->result();
-                    },
-                ],
-                'PV_PSS' => [
-                    'header' => '新增团队业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_PSS'],
-                        ]))->result();
-                    },
-                ],
-                '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'=> '期数'],
-                'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
-                'CREATED_AT'=> ['isUserTable'=> false, 'name'=> '创建时间', 'other'=> 'date'],
-            ];
-        }
-        return $this->filterTypes;
-    }
+<?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 PeriodPerfList 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'=>'PM.*, U.USER_NAME, U.REAL_NAME',
+            'from' => PerfPeriod::tableName().' AS PM',
+            'join' => [
+                ['LEFT JOIN', modelUser::tableName() . ' AS U', 'PM.USER_ID=U.ID'],
+            ],
+            'orderBy' => 'PM.CREATED_AT DESC, PM.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' => '期数',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+                'USER_NAME' => [
+                    'header' => '会员编号',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+                'REAL_NAME' => [
+                    'header' => '会员姓名',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'LAST_DEC_LV_NAME' => [
+                    'header' => '结算时会员级别',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'LAST_EMP_LV_NAME' => [
+                    'header' => '最新聘级',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'PV_PCS' => [
+                    'header' => '个人业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_PCS'],
+                        ]))->result();
+                    },
+                ],
+                'PV_PSS' => [
+                    'header' => '新增团队业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_PSS'],
+                        ]))->result();
+                    },
+                ],
+                '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'=> '期数'],
+                'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
+                'CREATED_AT'=> ['isUserTable'=> false, 'name'=> '创建时间', 'other'=> 'date'],
+            ];
+        }
+        return $this->filterTypes;
+    }
 }

+ 201 - 201
backendApi/modules/v1/models/lists/bonus/TraceDownBdList.php

@@ -1,202 +1,202 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusBD;
-use common\models\CalcBonusYC;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceDownBdList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '服务奖向下追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->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;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusBD;
+use common\models\CalcBonusYC;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceDownBdList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '服务奖向下追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->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;
+    }
+
 }

+ 200 - 200
backendApi/modules/v1/models/lists/bonus/TraceDownGlList.php

@@ -1,201 +1,201 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusGL;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceDownGlList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '管理奖向下追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusGL::lists($this->condition, $this->params, [
-            'select' => 'CGL.*',
-            'from' => CalcBonusGL::tableName() . ' AS CGL',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CGL.USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CGL.CREATED_AT ASC, CGL.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;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusGL;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceDownGlList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '管理奖向下追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusGL::lists($this->condition, $this->params, [
+            'select' => 'CGL.*',
+            'from' => CalcBonusGL::tableName() . ' AS CGL',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CGL.USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CGL.CREATED_AT ASC, CGL.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;
+    }
+
 }

+ 201 - 201
backendApi/modules/v1/models/lists/bonus/TraceDownGxList.php

@@ -1,202 +1,202 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusGX;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceDownGxList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '共享奖向下追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusGX::lists($this->condition, $this->params, [
-            'select' => 'CGX.*',
-            'from' => CalcBonusGX::tableName() . ' AS CGX',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CGX.USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CGX.CREATED_AT ASC, CGX.ID ASC',
-            'yearMonth' => $yearMonth,
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        if ($data['list']) {
-            foreach ($data['list'] as $key => $value) {
-                $userInfo = Info::baseInfo($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'] ?? '';
-                unset($showFromInfo);
-
-            }
-        }
-        $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_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'],
-                        ];
-                    },
-                ],
-//                'DEEP' => [
-//                    'header' => '紧缩代数',
-//                    'headerOther' => [
-//                        'width' => '80',
-//                    ],
-//                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [];
-        }
-        return $this->filterTypes;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusGX;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceDownGxList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '共享奖向下追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusGX::lists($this->condition, $this->params, [
+            'select' => 'CGX.*',
+            'from' => CalcBonusGX::tableName() . ' AS CGX',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CGX.USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CGX.CREATED_AT ASC, CGX.ID ASC',
+            'yearMonth' => $yearMonth,
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        if ($data['list']) {
+            foreach ($data['list'] as $key => $value) {
+                $userInfo = Info::baseInfo($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'] ?? '';
+                unset($showFromInfo);
+
+            }
+        }
+        $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_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'],
+                        ];
+                    },
+                ],
+//                'DEEP' => [
+//                    'header' => '紧缩代数',
+//                    'headerOther' => [
+//                        'width' => '80',
+//                    ],
+//                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [];
+        }
+        return $this->filterTypes;
+    }
+
 }

+ 182 - 182
backendApi/modules/v1/models/lists/bonus/TraceDownQyList.php

@@ -1,183 +1,183 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\PerfOrder;
-use common\models\Period;
-use common\models\Region;
-use common\models\User;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceDownQyList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '团队奖向下追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-//        $periodNum = $this->others['periodNum'];
-        $this->listData = PerfOrder::lists($this->condition, $this->params, [
-            'select' => 'PO.PERIOD_NUM,PO.USER_ID,U.USER_NAME,U.REAL_NAME,PO.LAST_STATUS,PO.LAST_DEC_LV,PO.LAST_EMP_LV,PO.DEC_TYPE,PO.DEC_AMOUNT,PO.PV,PO.CALC_MONTH',
-            'from' => PerfOrder::tableName() . ' AS PO',
-            'join' => [
-                ['LEFT JOIN', User::tableName() . ' AS U', 'PO.USER_ID=U.ID'],
-            ],
-            'yearMonth' => $yearMonth,
-            'orderBy' => 'U.ID ASC',
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        $decConfig = Cache::getDecLevelConfig();
-        $empConfig = Cache::getEmpLevelConfig();
-        if ($this->listData['list']) {
-            foreach ($this->listData['list'] as $key => $value) {
-                $this->listData['list'][$key]['LAST_DEC_LV_NAME'] = $decConfig[$value['LAST_DEC_LV']]['LEVEL_NAME'] ?? '';
-                $this->listData['list'][$key]['LAST_EMP_LV_NAME'] = $empConfig[$value['LAST_EMP_LV']]['LEVEL_NAME'] ?? '';
-                $this->listData['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_STATUS']]['label'] ?? '';
-            }
-        }
-    }
-
-    /**
-     * 要展示和导出的所有字段
-     * @return array
-     */
-    public function getColumn(){
-        if(!$this->columns){
-            $this->columns = [
-                'PERIOD_NUM' => [
-                    'header' => '期数',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                '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' => '150',
-                    ],
-                ],
-                'LAST_DEC_LV_NAME' => [
-                    'header' => '结算时会员级别',
-                    'headerOther' => [
-                        'width' => '120',
-                    ],
-                ],
-                'LAST_EMP_LV_NAME' => [
-                    'header' => '结算时会员聘级',
-                    'headerOther' => [
-                        'width' => '140',
-                    ],
-                ],
-//                'LOCATION' => [
-//                    'header' => '市场',
-//                    'headerOther' => [
-//                        'width' => '100',
-//                    ],
-//                ],
-                'DEC_TYPE' => [
-                    'header' => '报单类型',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                    'value' => function($row) {
-                        $decType = [
-                            'ZC'=> '首购单',
-                            'YH'=> '优惠单',
-                            'ZG'=> '增购单',
-                            'LS'=> '零售单',
-                            'FX'=> '复销单',
-                        ];
-                        return $decType[$row['DEC_TYPE']];
-                    },
-                ],
-                'DEC_AMOUNT' => [
-                    'header' => '报单金额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['DEC_AMOUNT'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '150',
-                        'prop'=>'DEC_AMOUNT',
-                    ],
-                ],
-                'PV' => [
-                    'header' => '报单PV',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '150',
-                        'prop'=>'PV',
-                    ],
-                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [];
-        }
-        return $this->filterTypes;
-    }
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\PerfOrder;
+use common\models\Period;
+use common\models\Region;
+use common\models\User;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceDownQyList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '团队奖向下追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+//        $periodNum = $this->others['periodNum'];
+        $this->listData = PerfOrder::lists($this->condition, $this->params, [
+            'select' => 'PO.PERIOD_NUM,PO.USER_ID,U.USER_NAME,U.REAL_NAME,PO.LAST_STATUS,PO.LAST_DEC_LV,PO.LAST_EMP_LV,PO.DEC_TYPE,PO.DEC_AMOUNT,PO.PV,PO.CALC_MONTH',
+            'from' => PerfOrder::tableName() . ' AS PO',
+            'join' => [
+                ['LEFT JOIN', User::tableName() . ' AS U', 'PO.USER_ID=U.ID'],
+            ],
+            'yearMonth' => $yearMonth,
+            'orderBy' => 'U.ID ASC',
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        $decConfig = Cache::getDecLevelConfig();
+        $empConfig = Cache::getEmpLevelConfig();
+        if ($this->listData['list']) {
+            foreach ($this->listData['list'] as $key => $value) {
+                $this->listData['list'][$key]['LAST_DEC_LV_NAME'] = $decConfig[$value['LAST_DEC_LV']]['LEVEL_NAME'] ?? '';
+                $this->listData['list'][$key]['LAST_EMP_LV_NAME'] = $empConfig[$value['LAST_EMP_LV']]['LEVEL_NAME'] ?? '';
+                $this->listData['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_STATUS']]['label'] ?? '';
+            }
+        }
+    }
+
+    /**
+     * 要展示和导出的所有字段
+     * @return array
+     */
+    public function getColumn(){
+        if(!$this->columns){
+            $this->columns = [
+                'PERIOD_NUM' => [
+                    'header' => '期数',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                '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' => '150',
+                    ],
+                ],
+                'LAST_DEC_LV_NAME' => [
+                    'header' => '结算时会员级别',
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                ],
+                'LAST_EMP_LV_NAME' => [
+                    'header' => '最新聘级',
+                    'headerOther' => [
+                        'width' => '140',
+                    ],
+                ],
+//                'LOCATION' => [
+//                    'header' => '市场',
+//                    'headerOther' => [
+//                        'width' => '100',
+//                    ],
+//                ],
+                'DEC_TYPE' => [
+                    'header' => '报单类型',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                    'value' => function($row) {
+                        $decType = [
+                            'ZC'=> '首购单',
+                            'YH'=> '优惠单',
+                            'ZG'=> '增购单',
+                            'LS'=> '零售单',
+                            'FX'=> '复销单',
+                        ];
+                        return $decType[$row['DEC_TYPE']];
+                    },
+                ],
+                'DEC_AMOUNT' => [
+                    'header' => '报单金额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['DEC_AMOUNT'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '150',
+                        'prop'=>'DEC_AMOUNT',
+                    ],
+                ],
+                'PV' => [
+                    'header' => '报单PV',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '150',
+                        'prop'=>'PV',
+                    ],
+                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [];
+        }
+        return $this->filterTypes;
+    }
 }

+ 201 - 201
backendApi/modules/v1/models/lists/bonus/TraceDownTgList.php

@@ -1,202 +1,202 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusTG;
-use common\models\CalcBonusYC;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceDownTgList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '推广奖向下追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusTG::lists($this->condition, $this->params, [
-            'select' => 'CTG.*',
-            'from' => CalcBonusTG::tableName() . ' AS CTG',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CTG.USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CTG.CREATED_AT ASC, CTG.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;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusTG;
+use common\models\CalcBonusYC;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceDownTgList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '推广奖向下追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusTG::lists($this->condition, $this->params, [
+            'select' => 'CTG.*',
+            'from' => CalcBonusTG::tableName() . ' AS CTG',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CTG.USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CTG.CREATED_AT ASC, CTG.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;
+    }
+
 }

+ 202 - 202
backendApi/modules/v1/models/lists/bonus/TraceDownXfList.php

@@ -1,203 +1,203 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusTG;
-use common\models\CalcBonusXF;
-use common\models\CalcBonusYC;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceDownXfList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '消费奖向下追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusTG::lists($this->condition, $this->params, [
-            'select' => 'CXF.*',
-            'from' => CalcBonusXF::tableName() . ' AS CXF',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CXF.USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CXF.CREATED_AT ASC, CXF.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;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusTG;
+use common\models\CalcBonusXF;
+use common\models\CalcBonusYC;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceDownXfList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '消费奖向下追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusTG::lists($this->condition, $this->params, [
+            'select' => 'CXF.*',
+            'from' => CalcBonusXF::tableName() . ' AS CXF',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CXF.USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CXF.CREATED_AT ASC, CXF.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;
+    }
+
 }

+ 165 - 165
backendApi/modules/v1/models/lists/bonus/TraceDownYcList.php

@@ -1,166 +1,166 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusYC;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceDownYcList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '荣衔奖向下追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusYC::lists($this->condition, $this->params, [
-            'select' => 'CBY.*',
-            'from' => CalcBonusYC::tableName() . ' AS CBY',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CBY.USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CBY.DEEP ASC, CBY.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',
-                    ],
-                ],
-                'BONUS_TYPE' => [
-                    'header' => '奖金类型',
-                    'value' => function($row) {
-                        return CalcBonusYC::BONUS_TYPE_NAME[$row['BONUS_TYPE']] ?? '未知';
-                    },
-                    'headerOther' => ['width' => '110'],
-                ],
-                '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'],
-                        ];
-                    },
-                ],
-//                'DEEP' => [
-//                    'header' => '紧缩代数',
-//                    'headerOther' => [
-//                        'width' => '80',
-//                    ],
-//                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [];
-        }
-        return $this->filterTypes;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusYC;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceDownYcList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '荣衔奖向下追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusYC::lists($this->condition, $this->params, [
+            'select' => 'CBY.*',
+            'from' => CalcBonusYC::tableName() . ' AS CBY',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CBY.USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CBY.DEEP ASC, CBY.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',
+                    ],
+                ],
+                'BONUS_TYPE' => [
+                    'header' => '奖金类型',
+                    'value' => function($row) {
+                        return CalcBonusYC::BONUS_TYPE_NAME[$row['BONUS_TYPE']] ?? '未知';
+                    },
+                    'headerOther' => ['width' => '110'],
+                ],
+                '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'],
+                        ];
+                    },
+                ],
+//                'DEEP' => [
+//                    'header' => '紧缩代数',
+//                    'headerOther' => [
+//                        'width' => '80',
+//                    ],
+//                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [];
+        }
+        return $this->filterTypes;
+    }
+
 }

+ 200 - 200
backendApi/modules/v1/models/lists/bonus/TraceDownYjList.php

@@ -1,201 +1,201 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusYJ;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceDownYjList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '业绩奖向下追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusYJ::lists($this->condition, $this->params, [
-            'select' => 'CYJ.*',
-            'from' => CalcBonusYJ::tableName() . ' AS CYJ',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CYJ.USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CYJ.CREATED_AT ASC, CYJ.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;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusYJ;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceDownYjList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '业绩奖向下追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusYJ::lists($this->condition, $this->params, [
+            'select' => 'CYJ.*',
+            'from' => CalcBonusYJ::tableName() . ' AS CYJ',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CYJ.USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CYJ.CREATED_AT ASC, CYJ.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;
+    }
+
 }

+ 206 - 206
backendApi/modules/v1/models/lists/bonus/TraceUpBdList.php

@@ -1,207 +1,207 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusBD;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceUpBdList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '服务奖向上追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusBD::lists($this->condition, $this->params, [
-            'select' => 'CBB.*',
-            'from' => CalcBonusBD::tableName() . ' AS CBB',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CBB.FROM_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['USER_ID']);
-                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
-                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
-                        ];
-                    },
-                ],
-//                'DEEP' => [
-//                    'header' => '紧缩代数',
-//                    'headerOther' => [
-//                        'width' => '80',
-//                    ],
-//                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [];
-        }
-        return $this->filterTypes;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusBD;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceUpBdList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '服务奖向上追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusBD::lists($this->condition, $this->params, [
+            'select' => 'CBB.*',
+            'from' => CalcBonusBD::tableName() . ' AS CBB',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CBB.FROM_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['USER_ID']);
+                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
+                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
+                        ];
+                    },
+                ],
+//                'DEEP' => [
+//                    'header' => '紧缩代数',
+//                    'headerOther' => [
+//                        'width' => '80',
+//                    ],
+//                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [];
+        }
+        return $this->filterTypes;
+    }
+
 }

+ 206 - 206
backendApi/modules/v1/models/lists/bonus/TraceUpGlList.php

@@ -1,207 +1,207 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusGL;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceUpGlList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '管理奖向上追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusGL::lists($this->condition, $this->params, [
-            'select' => 'CGL.*',
-            'from' => CalcBonusGL::tableName() . ' AS CGL',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CGL.FROM_USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CGL.CREATED_AT ASC, CGL.ID ASC',
-            'yearMonth' => $yearMonth,
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        if ($data['list']) {
-            foreach ($data['list'] as $key => $value) {
-                $userInfo = Info::baseInfoZh($value['USER_ID']);
-                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
-                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
-                        ];
-                    },
-                ],
-//                'DEEP' => [
-//                    'header' => '紧缩代数',
-//                    'headerOther' => [
-//                        'width' => '80',
-//                    ],
-//                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [];
-        }
-        return $this->filterTypes;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusGL;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceUpGlList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '管理奖向上追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusGL::lists($this->condition, $this->params, [
+            'select' => 'CGL.*',
+            'from' => CalcBonusGL::tableName() . ' AS CGL',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CGL.FROM_USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CGL.CREATED_AT ASC, CGL.ID ASC',
+            'yearMonth' => $yearMonth,
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        if ($data['list']) {
+            foreach ($data['list'] as $key => $value) {
+                $userInfo = Info::baseInfoZh($value['USER_ID']);
+                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
+                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
+                        ];
+                    },
+                ],
+//                'DEEP' => [
+//                    'header' => '紧缩代数',
+//                    'headerOther' => [
+//                        'width' => '80',
+//                    ],
+//                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [];
+        }
+        return $this->filterTypes;
+    }
+
 }

+ 206 - 206
backendApi/modules/v1/models/lists/bonus/TraceUpGxList.php

@@ -1,207 +1,207 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusGX;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceUpGxList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '共享奖向上追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusGX::lists($this->condition, $this->params, [
-            'select' => 'CGX.*',
-            'from' => CalcBonusGX::tableName() . ' AS CGX',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CGX.FROM_USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CGX.CREATED_AT ASC, CGX.ID ASC',
-            'yearMonth' => $yearMonth,
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        if ($data['list']) {
-            foreach ($data['list'] as $key => $value) {
-                $userInfo = Info::baseInfoZh($value['USER_ID']);
-                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
-                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
-                        ];
-                    },
-                ],
-//                'DEEP' => [
-//                    'header' => '紧缩代数',
-//                    'headerOther' => [
-//                        'width' => '80',
-//                    ],
-//                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [];
-        }
-        return $this->filterTypes;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusGX;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceUpGxList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '共享奖向上追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusGX::lists($this->condition, $this->params, [
+            'select' => 'CGX.*',
+            'from' => CalcBonusGX::tableName() . ' AS CGX',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CGX.FROM_USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CGX.CREATED_AT ASC, CGX.ID ASC',
+            'yearMonth' => $yearMonth,
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        if ($data['list']) {
+            foreach ($data['list'] as $key => $value) {
+                $userInfo = Info::baseInfoZh($value['USER_ID']);
+                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
+                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
+                        ];
+                    },
+                ],
+//                'DEEP' => [
+//                    'header' => '紧缩代数',
+//                    'headerOther' => [
+//                        'width' => '80',
+//                    ],
+//                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [];
+        }
+        return $this->filterTypes;
+    }
+
 }

+ 306 - 306
backendApi/modules/v1/models/lists/bonus/TraceUpQyList.php

@@ -1,307 +1,307 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceUpQyList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '团队奖向上追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $userId = $this->others['userId'];
-        $periodNum = $this->others['periodNum'];
-        $data = UserNetwork::getAllParentFromPeriodWithPage($userId, $periodNum);
-        if (isset($data['list']) && $data['list']) {
-            $decTotal = CalcCache::nowPeriodPerf($userId, $periodNum);
-            foreach ($data['list'] as $key => $value) {
-                $perfPeriod = PerfPeriod::findOneAsArray('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM',[':USER_ID'=>$value['USER_ID'],':PERIOD_NUM'=>$periodNum]);
-                $data['list'][$key]['PERIOD_NUM'] = $perfPeriod['PERIOD_NUM'];
-                $data['list'][$key]['DEC_TOTAL'] = $decTotal['PV_PCS_ZC'] + $decTotal['PV_PCS_ZG'] +$decTotal['PV_LS_TOUCH'];
-                $data['list'][$key]['USER_NAME'] = Info::getUserNameByUserId($value['USER_ID']);
-                $data['list'][$key]['REAL_NAME'] = Info::getUserRealNameByUserId($value['USER_ID']);
-                $data['list'][$key]['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$perfPeriod['LAST_DEC_LV']]['LEVEL_NAME'] ?? '';
-                $data['list'][$key]['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$perfPeriod['LAST_EMP_LV']]['LEVEL_NAME'] ?? '';
-                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$perfPeriod['LAST_STATUS']]['label'] ?? '';
-                $data['list'][$key]['PV_1L_TOUCH'] = $perfPeriod['PV_1L_TOUCH'];
-                $data['list'][$key]['PV_2L_TOUCH'] = $perfPeriod['PV_2L_TOUCH'];
-                $data['list'][$key]['PV_3L_TOUCH'] = $perfPeriod['PV_3L_TOUCH'];
-                $data['list'][$key]['PV_4L_TOUCH'] = $perfPeriod['PV_4L_TOUCH'];
-                $data['list'][$key]['PV_5L_TOUCH'] = $perfPeriod['PV_5L_TOUCH'];
-                $data['list'][$key]['SURPLUS_1L'] = $perfPeriod['SURPLUS_1L'];
-                $data['list'][$key]['SURPLUS_2L'] = $perfPeriod['SURPLUS_2L'];
-                $data['list'][$key]['SURPLUS_3L'] = $perfPeriod['SURPLUS_3L'];
-                $data['list'][$key]['SURPLUS_4L'] = $perfPeriod['SURPLUS_4L'];
-                $data['list'][$key]['SURPLUS_5L'] = $perfPeriod['SURPLUS_5L'];
-                $data['list'][$key]['CALC_MONTH'] = $perfPeriod['CALC_MONTH'];
-                //区域业绩
-                $pervSurplusPerf = CalcCache::surplusPerf($value['USER_ID'], $periodNum);
-                $data['list'][$key]['QY_1L'] = $data['list'][$key]['PV_1L_TOUCH'] + $pervSurplusPerf['SURPLUS_1L'];
-                $data['list'][$key]['QY_2L'] = $data['list'][$key]['PV_2L_TOUCH'] + $pervSurplusPerf['SURPLUS_2L'];
-                $data['list'][$key]['QY_3L'] = $data['list'][$key]['PV_3L_TOUCH'] + $pervSurplusPerf['SURPLUS_3L'];
-                $data['list'][$key]['QY_4L'] = $data['list'][$key]['PV_4L_TOUCH'] + $pervSurplusPerf['SURPLUS_4L'];
-                $data['list'][$key]['QY_5L'] = $data['list'][$key]['PV_5L_TOUCH'] + $pervSurplusPerf['SURPLUS_5L'];
-                unset($bonus,$bigLocation);
-            }
-        } else {
-            $data['list'] = [];
-        }
-        $this->listData = $data;
-    }
-
-    /**
-     * 要展示和导出的所有字段
-     * @return array
-     */
-    public function getColumn(){
-        if(!$this->columns){
-            $this->columns = [
-                'PERIOD_NUM' => [
-                    'header' => '期数',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                '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']
-                    ],
-                ],
-                'LOCATION' => [
-                    'header' => '市场',
-                    'headerOther' => [
-                        'width' => '100',
-                    ],
-                ],
-                'LAST_STATUS_NAME' => [
-                    'header' => '结算时状态',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-                'LAST_DEC_LV_NAME' => [
-                    'header' => '结算时会员级别',
-                    'headerOther' => [
-                        'width' => '120',
-                    ],
-                ],
-                'LAST_EMP_LV_NAME' => [
-                    'header' => '结算时会员聘级',
-                    'headerOther' => [
-                        'width' => '140',
-                    ],
-                ],
-                'DEC_TOTAL' => [
-                    'header' => '报单总积分',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['DEC_TOTAL'],
-                        ]))->result();
-                    },
-                ],
-                'PV_1L_TOUCH' => [
-                    'header' => '一市场新增业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_1L_TOUCH'],
-                        ]))->result();
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
-                    ]
-                ],
-                'QY_1L' => [
-                    'header' => '一市场区域业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['QY_1L'],
-                        ]))->result();
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
-                    ]
-                ],
-                'SURPLUS_1L' => [
-                    'header' => '一市场结余业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['SURPLUS_1L'],
-                        ]))->result();
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
-                    ]
-                ],
-                'PV_2L_TOUCH' => [
-                    'header' => '二市场新增业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_2L_TOUCH'],
-                        ]))->result();
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
-                    ]
-                ],
-                'QY_2L' => [
-                    'header' => '二市场区域业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['QY_2L'],
-                        ]))->result();
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
-                    ]
-                ],
-                'SURPLUS_2L' => [
-                    'header' => '二市场结余业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['SURPLUS_2L'],
-                        ]))->result();
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
-                    ]
-                ],
-                'PV_3L_TOUCH' => [
-                    'header' => '三市场新增业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['PV_3L_TOUCH'],
-                        ]))->result();
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
-                    ]
-                ],
-                'QY_3L' => [
-                    'header' => '三市场区域业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['QY_3L'],
-                        ]))->result();
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
-                    ]
-                ],
-                'SURPLUS_3L' => [
-                    'header' => '三市场结余业绩',
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['SURPLUS_3L'],
-                        ]))->result();
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'info', '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;
-    }
-
-    /**
-     * 校验大区
-     * @param $big
-     * @param $loc
-     * @param $num
-     * @return bool
-     */
-    private function _chkBig($big, $loc, $num){
-        return $loc == $num && $big != $loc;
-    }
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceUpQyList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '团队奖向上追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $userId = $this->others['userId'];
+        $periodNum = $this->others['periodNum'];
+        $data = UserNetwork::getAllParentFromPeriodWithPage($userId, $periodNum);
+        if (isset($data['list']) && $data['list']) {
+            $decTotal = CalcCache::nowPeriodPerf($userId, $periodNum);
+            foreach ($data['list'] as $key => $value) {
+                $perfPeriod = PerfPeriod::findOneAsArray('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM',[':USER_ID'=>$value['USER_ID'],':PERIOD_NUM'=>$periodNum]);
+                $data['list'][$key]['PERIOD_NUM'] = $perfPeriod['PERIOD_NUM'];
+                $data['list'][$key]['DEC_TOTAL'] = $decTotal['PV_PCS_ZC'] + $decTotal['PV_PCS_ZG'] +$decTotal['PV_LS_TOUCH'];
+                $data['list'][$key]['USER_NAME'] = Info::getUserNameByUserId($value['USER_ID']);
+                $data['list'][$key]['REAL_NAME'] = Info::getUserRealNameByUserId($value['USER_ID']);
+                $data['list'][$key]['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$perfPeriod['LAST_DEC_LV']]['LEVEL_NAME'] ?? '';
+                $data['list'][$key]['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$perfPeriod['LAST_EMP_LV']]['LEVEL_NAME'] ?? '';
+                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$perfPeriod['LAST_STATUS']]['label'] ?? '';
+                $data['list'][$key]['PV_1L_TOUCH'] = $perfPeriod['PV_1L_TOUCH'];
+                $data['list'][$key]['PV_2L_TOUCH'] = $perfPeriod['PV_2L_TOUCH'];
+                $data['list'][$key]['PV_3L_TOUCH'] = $perfPeriod['PV_3L_TOUCH'];
+                $data['list'][$key]['PV_4L_TOUCH'] = $perfPeriod['PV_4L_TOUCH'];
+                $data['list'][$key]['PV_5L_TOUCH'] = $perfPeriod['PV_5L_TOUCH'];
+                $data['list'][$key]['SURPLUS_1L'] = $perfPeriod['SURPLUS_1L'];
+                $data['list'][$key]['SURPLUS_2L'] = $perfPeriod['SURPLUS_2L'];
+                $data['list'][$key]['SURPLUS_3L'] = $perfPeriod['SURPLUS_3L'];
+                $data['list'][$key]['SURPLUS_4L'] = $perfPeriod['SURPLUS_4L'];
+                $data['list'][$key]['SURPLUS_5L'] = $perfPeriod['SURPLUS_5L'];
+                $data['list'][$key]['CALC_MONTH'] = $perfPeriod['CALC_MONTH'];
+                //区域业绩
+                $pervSurplusPerf = CalcCache::surplusPerf($value['USER_ID'], $periodNum);
+                $data['list'][$key]['QY_1L'] = $data['list'][$key]['PV_1L_TOUCH'] + $pervSurplusPerf['SURPLUS_1L'];
+                $data['list'][$key]['QY_2L'] = $data['list'][$key]['PV_2L_TOUCH'] + $pervSurplusPerf['SURPLUS_2L'];
+                $data['list'][$key]['QY_3L'] = $data['list'][$key]['PV_3L_TOUCH'] + $pervSurplusPerf['SURPLUS_3L'];
+                $data['list'][$key]['QY_4L'] = $data['list'][$key]['PV_4L_TOUCH'] + $pervSurplusPerf['SURPLUS_4L'];
+                $data['list'][$key]['QY_5L'] = $data['list'][$key]['PV_5L_TOUCH'] + $pervSurplusPerf['SURPLUS_5L'];
+                unset($bonus,$bigLocation);
+            }
+        } else {
+            $data['list'] = [];
+        }
+        $this->listData = $data;
+    }
+
+    /**
+     * 要展示和导出的所有字段
+     * @return array
+     */
+    public function getColumn(){
+        if(!$this->columns){
+            $this->columns = [
+                'PERIOD_NUM' => [
+                    'header' => '期数',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                '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']
+                    ],
+                ],
+                'LOCATION' => [
+                    'header' => '市场',
+                    'headerOther' => [
+                        'width' => '100',
+                    ],
+                ],
+                'LAST_STATUS_NAME' => [
+                    'header' => '结算时状态',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+                'LAST_DEC_LV_NAME' => [
+                    'header' => '结算时会员级别',
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                ],
+                'LAST_EMP_LV_NAME' => [
+                    'header' => '最新聘级',
+                    'headerOther' => [
+                        'width' => '140',
+                    ],
+                ],
+                'DEC_TOTAL' => [
+                    'header' => '报单总积分',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['DEC_TOTAL'],
+                        ]))->result();
+                    },
+                ],
+                'PV_1L_TOUCH' => [
+                    'header' => '一市场新增业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_1L_TOUCH'],
+                        ]))->result();
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
+                    ]
+                ],
+                'QY_1L' => [
+                    'header' => '一市场区域业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['QY_1L'],
+                        ]))->result();
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
+                    ]
+                ],
+                'SURPLUS_1L' => [
+                    'header' => '一市场结余业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['SURPLUS_1L'],
+                        ]))->result();
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
+                    ]
+                ],
+                'PV_2L_TOUCH' => [
+                    'header' => '二市场新增业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_2L_TOUCH'],
+                        ]))->result();
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
+                    ]
+                ],
+                'QY_2L' => [
+                    'header' => '二市场区域业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['QY_2L'],
+                        ]))->result();
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
+                    ]
+                ],
+                'SURPLUS_2L' => [
+                    'header' => '二市场结余业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['SURPLUS_2L'],
+                        ]))->result();
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
+                    ]
+                ],
+                'PV_3L_TOUCH' => [
+                    'header' => '三市场新增业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['PV_3L_TOUCH'],
+                        ]))->result();
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
+                    ]
+                ],
+                'QY_3L' => [
+                    'header' => '三市场区域业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['QY_3L'],
+                        ]))->result();
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border'],
+                    ]
+                ],
+                'SURPLUS_3L' => [
+                    'header' => '三市场结余业绩',
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['SURPLUS_3L'],
+                        ]))->result();
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'info', '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;
+    }
+
+    /**
+     * 校验大区
+     * @param $big
+     * @param $loc
+     * @param $num
+     * @return bool
+     */
+    private function _chkBig($big, $loc, $num){
+        return $loc == $num && $big != $loc;
+    }
 }

+ 206 - 206
backendApi/modules/v1/models/lists/bonus/TraceUpTgList.php

@@ -1,207 +1,207 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusTG;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceUpTgList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '推广奖向上追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusTG::lists($this->condition, $this->params, [
-            'select' => 'CTG.*',
-            'from' => CalcBonusTG::tableName() . ' AS CTG',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CTG.FROM_USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CTG.CREATED_AT ASC, CTG.ID ASC',
-            'yearMonth' => $yearMonth,
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        if ($data['list']) {
-            foreach ($data['list'] as $key => $value) {
-                $userInfo = Info::baseInfoZh($value['USER_ID']);
-                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
-                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
-                        ];
-                    },
-                ],
-//                'DEEP' => [
-//                    'header' => '紧缩代数',
-//                    'headerOther' => [
-//                        'width' => '80',
-//                    ],
-//                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [];
-        }
-        return $this->filterTypes;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusTG;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceUpTgList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '推广奖向上追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusTG::lists($this->condition, $this->params, [
+            'select' => 'CTG.*',
+            'from' => CalcBonusTG::tableName() . ' AS CTG',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CTG.FROM_USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CTG.CREATED_AT ASC, CTG.ID ASC',
+            'yearMonth' => $yearMonth,
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        if ($data['list']) {
+            foreach ($data['list'] as $key => $value) {
+                $userInfo = Info::baseInfoZh($value['USER_ID']);
+                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
+                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
+                        ];
+                    },
+                ],
+//                'DEEP' => [
+//                    'header' => '紧缩代数',
+//                    'headerOther' => [
+//                        'width' => '80',
+//                    ],
+//                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [];
+        }
+        return $this->filterTypes;
+    }
+
 }

+ 206 - 206
backendApi/modules/v1/models/lists/bonus/TraceUpXfList.php

@@ -1,207 +1,207 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusTG;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceUpXfList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '消费奖向上追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusTG::lists($this->condition, $this->params, [
-            'select' => 'CXF.*',
-            'from' => CalcBonusTG::tableName() . ' AS CXF',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CXF.FROM_USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CXF.CREATED_AT ASC, CXF.ID ASC',
-            'yearMonth' => $yearMonth,
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        if ($data['list']) {
-            foreach ($data['list'] as $key => $value) {
-                $userInfo = Info::baseInfoZh($value['USER_ID']);
-                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
-                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
-                        ];
-                    },
-                ],
-//                'DEEP' => [
-//                    'header' => '紧缩代数',
-//                    'headerOther' => [
-//                        'width' => '80',
-//                    ],
-//                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [];
-        }
-        return $this->filterTypes;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusTG;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceUpXfList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '消费奖向上追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusTG::lists($this->condition, $this->params, [
+            'select' => 'CXF.*',
+            'from' => CalcBonusTG::tableName() . ' AS CXF',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CXF.FROM_USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CXF.CREATED_AT ASC, CXF.ID ASC',
+            'yearMonth' => $yearMonth,
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        if ($data['list']) {
+            foreach ($data['list'] as $key => $value) {
+                $userInfo = Info::baseInfoZh($value['USER_ID']);
+                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
+                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
+                        ];
+                    },
+                ],
+//                'DEEP' => [
+//                    'header' => '紧缩代数',
+//                    'headerOther' => [
+//                        'width' => '80',
+//                    ],
+//                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [];
+        }
+        return $this->filterTypes;
+    }
+
 }

+ 206 - 206
backendApi/modules/v1/models/lists/bonus/TraceUpYcList.php

@@ -1,207 +1,207 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusYC;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceUpYcList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '荣衔奖向上追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusYC::lists($this->condition, $this->params, [
-            'select' => 'CBY.*',
-            'from' => CalcBonusYC::tableName() . ' AS CBY',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CBY.FROM_USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CBY.DEEP ASC, CBY.ID ASC',
-            'yearMonth' => $yearMonth,
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        if ($data['list']) {
-            foreach ($data['list'] as $key => $value) {
-                $userInfo = Info::baseInfoZh($value['USER_ID']);
-                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
-                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
-                        ];
-                    },
-                ],
-//                'DEEP' => [
-//                    'header' => '紧缩代数',
-//                    'headerOther' => [
-//                        'width' => '80',
-//                    ],
-//                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [];
-        }
-        return $this->filterTypes;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusYC;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceUpYcList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '荣衔奖向上追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusYC::lists($this->condition, $this->params, [
+            'select' => 'CBY.*',
+            'from' => CalcBonusYC::tableName() . ' AS CBY',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CBY.FROM_USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CBY.DEEP ASC, CBY.ID ASC',
+            'yearMonth' => $yearMonth,
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        if ($data['list']) {
+            foreach ($data['list'] as $key => $value) {
+                $userInfo = Info::baseInfoZh($value['USER_ID']);
+                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
+                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
+                        ];
+                    },
+                ],
+//                'DEEP' => [
+//                    'header' => '紧缩代数',
+//                    'headerOther' => [
+//                        'width' => '80',
+//                    ],
+//                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [];
+        }
+        return $this->filterTypes;
+    }
+
 }

+ 206 - 206
backendApi/modules/v1/models/lists/bonus/TraceUpYjList.php

@@ -1,207 +1,207 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\bonus\CalcCache;
-use common\helpers\Cache;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\libs\dataList\column\Price;
-use common\libs\dataList\column\YesNo;
-use common\libs\dataList\DataListInterface;
-use common\models\CalcBonus;
-use common\models\CalcBonusYJ;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\Period;
-use common\models\Region;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use common\models\Withdraw;
-use Yii;
-
-class TraceUpYjList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '业绩奖向上追溯';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $yearMonth = $this->others['yearMonth'];
-        $data = CalcBonusYJ::lists($this->condition, $this->params, [
-            'select' => 'CYJ.*',
-            'from' => CalcBonusYJ::tableName() . ' AS CYJ',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CYJ.FROM_USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'CYJ.CREATED_AT ASC, CYJ.ID ASC',
-            'yearMonth' => $yearMonth,
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        if ($data['list']) {
-            foreach ($data['list'] as $key => $value) {
-                $userInfo = Info::baseInfoZh($value['USER_ID']);
-                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
-                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
-                        ];
-                    },
-                ],
-//                'DEEP' => [
-//                    'header' => '紧缩代数',
-//                    'headerOther' => [
-//                        'width' => '80',
-//                    ],
-//                ],
-                'CALC_MONTH' => [
-                    'header' => '结算月',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [];
-        }
-        return $this->filterTypes;
-    }
-
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+use common\helpers\bonus\CalcCache;
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\column\Price;
+use common\libs\dataList\column\YesNo;
+use common\libs\dataList\DataListInterface;
+use common\models\CalcBonus;
+use common\models\CalcBonusYJ;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\Period;
+use common\models\Region;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use common\models\Withdraw;
+use Yii;
+
+class TraceUpYjList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '业绩奖向上追溯';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $yearMonth = $this->others['yearMonth'];
+        $data = CalcBonusYJ::lists($this->condition, $this->params, [
+            'select' => 'CYJ.*',
+            'from' => CalcBonusYJ::tableName() . ' AS CYJ',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CYJ.FROM_USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'CYJ.CREATED_AT ASC, CYJ.ID ASC',
+            'yearMonth' => $yearMonth,
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        if ($data['list']) {
+            foreach ($data['list'] as $key => $value) {
+                $userInfo = Info::baseInfoZh($value['USER_ID']);
+                $data['list'][$key] = array_merge($userInfo, $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'] ?? '';
+                $data['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_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'],
+                        ];
+                    },
+                ],
+//                'DEEP' => [
+//                    'header' => '紧缩代数',
+//                    'headerOther' => [
+//                        'width' => '80',
+//                    ],
+//                ],
+                'CALC_MONTH' => [
+                    'header' => '结算月',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [];
+        }
+        return $this->filterTypes;
+    }
+
 }