Browse Source

merge new-version

root 3 years ago
parent
commit
a033d177c1
75 changed files with 10290 additions and 10099 deletions
  1. 2 2
      backendApi/config/menu.php
  2. 3 3
      backendApi/modules/v1/controllers/BonusController.php
  3. 1 0
      backendApi/modules/v1/controllers/ShopController.php
  4. 1 1
      backendApi/modules/v1/models/AdminForm.php
  5. 421 421
      backendApi/modules/v1/models/lists/bonus/BalanceList.php
  6. 206 206
      backendApi/modules/v1/models/lists/bonus/FlowExchangePointsList.php
  7. 555 555
      backendApi/modules/v1/models/lists/bonus/OtherPeriodBonusList.php
  8. 228 228
      backendApi/modules/v1/models/lists/bonus/PerfMonthList.php
  9. 152 152
      backendApi/modules/v1/models/lists/bonus/PerfStandardList.php
  10. 713 713
      backendApi/modules/v1/models/lists/bonus/PeriodBonusList.php
  11. 135 135
      backendApi/modules/v1/models/lists/bonus/PeriodPerfList.php
  12. 201 201
      backendApi/modules/v1/models/lists/bonus/TraceDownBdList.php
  13. 200 200
      backendApi/modules/v1/models/lists/bonus/TraceDownGlList.php
  14. 201 201
      backendApi/modules/v1/models/lists/bonus/TraceDownGxList.php
  15. 182 182
      backendApi/modules/v1/models/lists/bonus/TraceDownQyList.php
  16. 201 201
      backendApi/modules/v1/models/lists/bonus/TraceDownTgList.php
  17. 202 202
      backendApi/modules/v1/models/lists/bonus/TraceDownXfList.php
  18. 165 165
      backendApi/modules/v1/models/lists/bonus/TraceDownYcList.php
  19. 200 200
      backendApi/modules/v1/models/lists/bonus/TraceDownYjList.php
  20. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpBdList.php
  21. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpGlList.php
  22. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpGxList.php
  23. 306 306
      backendApi/modules/v1/models/lists/bonus/TraceUpQyList.php
  24. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpTgList.php
  25. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpXfList.php
  26. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpYcList.php
  27. 206 206
      backendApi/modules/v1/models/lists/bonus/TraceUpYjList.php
  28. 2 0
      backendApi/modules/v1/models/lists/shop/DecOrderList.php
  29. 623 623
      backendApi/modules/v1/models/lists/user/IndexList.php
  30. 1 1
      backendEle/src/router/index.js
  31. 253 253
      backendEle/src/utils/network.js
  32. 0 0
      backendEle/src/views/bonus/prepare-period.vue
  33. 1 1
      backendEle/src/views/config/transfer.vue
  34. 4 1
      backendEle/src/views/finance/change-balance-opt.vue
  35. 181 181
      backendEle/src/views/reconsume/pool-list.vue
  36. 1 0
      backendEle/src/views/shop/dec-order-list.vue
  37. 846 845
      backendEle/src/views/user/index.vue
  38. 52 52
      common/components/Controller.php
  39. 69 58
      common/config/main.php
  40. 1 1
      common/config/params.php
  41. 156 156
      common/helpers/CaptchaAction.php
  42. 124 4
      common/helpers/bonus/BonusCalc.php
  43. 6 1
      common/helpers/bonus/BonusSend.php
  44. 2 0
      common/helpers/bonus/CalcCache.php
  45. 0 0
      common/helpers/bonus/PrepareCalcCache.php
  46. 0 0
      common/helpers/bonus/PreparePerfCalc.php
  47. 2 0
      common/libs/dataList/DataList.php
  48. 1 1
      common/models/BalanceAudit.php
  49. 290 290
      common/models/CalcBonus.php
  50. 69 69
      common/models/OrderGoods.php
  51. 71 71
      common/models/OrderGoodsDec.php
  52. 69 69
      common/models/OrderGoodsShop.php
  53. 0 0
      common/models/PerfMonthPrepare.php
  54. 0 0
      common/models/PerfOrderPrepare.php
  55. 0 0
      common/models/PerfPeriodPrepare.php
  56. 0 0
      common/models/PeriodPrepare.php
  57. 175 175
      common/models/ShopGoods.php
  58. 1 0
      common/models/Transfer.php
  59. 59 59
      common/models/UserPeriodExchangePoints.php
  60. 610 610
      common/models/forms/OrderForm.php
  61. 0 0
      common/models/forms/PreparePeriodForm.php
  62. 29 3
      common/models/forms/TransferForm.php
  63. 2 2
      console/controllers/BonusController.php
  64. 4 4
      frontendApi/modules/v1/controllers/BonusController.php
  65. 1 0
      frontendApi/modules/v1/controllers/FinanceController.php
  66. 236 235
      frontendApi/modules/v1/controllers/ShopController.php
  67. 2 1
      frontendEle/src/views/bonus/index.vue
  68. 48 47
      frontendEle/src/views/bonus/new.vue
  69. 101 99
      frontendEle/src/views/bonus/other.vue
  70. 0 0
      frontendEle/src/views/bonus/teams.vue
  71. 253 252
      frontendEle/src/views/dashboard/index.vue
  72. 11 4
      frontendEle/src/views/finance/transfer-add.vue
  73. 91 89
      frontendEle/src/views/shop/dec-order-list.vue
  74. 1 1
      frontendEle/src/views/shop/order.vue
  75. 125 125
      mysql_db_yyj.sql

+ 2 - 2
backendApi/config/menu.php

@@ -208,8 +208,8 @@ return [
 //            ['name'=>'领袖分红奖流水导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-lx-export', 'routePath'=>'bonus/flow-lx-export', 'show'=>0,],
             ['name'=>'复消积分流水', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-rp', 'routePath'=>'bonus/flow-rp', 'show'=>1,],
             ['name'=>'复消积分流水导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-rp-export', 'routePath'=>'bonus/flow-rp-export', 'show'=>0,],
-            ['name'=>'兑换积分流水', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-exchange', 'routePath'=>'bonus/flow-exchange', 'show'=>1,],
-            ['name'=>'兑换积分流水导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-exchange-export', 'routePath'=>'bonus/flow-exchange-export', 'show'=>0,],
+            ['name'=>'兑换点数流水', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-exchange', 'routePath'=>'bonus/flow-exchange', 'show'=>1,],
+            ['name'=>'兑换点数流水导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-exchange-export', 'routePath'=>'bonus/flow-exchange-export', 'show'=>0,],
             ['name'=>'会员余额流水', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-balance', 'routePath'=>'bonus/flow-balance', 'show'=>1,],
             ['name'=>'会员余额流水导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-balance-export', 'routePath'=>'bonus/flow-balance-export', 'show'=>0,],
 //            ['name'=>'区域津贴核算', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'calc-qy', 'routePath'=>'bonus/calc-qy', 'show'=>1,],

+ 3 - 3
backendApi/modules/v1/controllers/BonusController.php

@@ -460,7 +460,7 @@ class BonusController extends BaseController {
 
 
     /**
-     * 兑换积分流水
+     * 兑换点数流水
      * @return mixed
      * @throws \yii\base\Exception
      * @throws \yii\web\HttpException
@@ -487,7 +487,7 @@ class BonusController extends BaseController {
     }
 
     /**
-     * 兑换积分流水导出
+     * 兑换点数流水导出
      * @return mixed
      * @throws \yii\db\Exception
      * @throws \yii\web\HttpException
@@ -507,7 +507,7 @@ class BonusController extends BaseController {
             'REMARK' => 'REMARK',
         ]);
         $form = new BonusExportForm();
-        $result = $form->run($filter, '兑换积分流水');
+        $result = $form->run($filter, '兑换点数流水');
         if (!$result) {
             return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
         }

+ 1 - 0
backendApi/modules/v1/controllers/ShopController.php

@@ -306,6 +306,7 @@ class ShopController extends BaseController {
             'CREATED_AT'=> 'DO.CREATED_AT',
             'UPDATED_AT'=> 'DO.UPDATED_AT',
         ]);
+
         $condition = $filter['condition'];
         $params = $filter['params'];
         $condition .= ' AND DO.IS_DEL=0';

+ 1 - 1
backendApi/modules/v1/models/AdminForm.php

@@ -89,7 +89,7 @@ class AdminForm extends Model
 
         if($this->scenario == 'add'){
             $model = new Admin();
-            $model->ADMIN_NAME = $this->adminName;
+            $model->ADMIN_NAME = strtolower($this->adminName);
             $model->REAL_NAME = $this->realName;
             $model->ROLE_ID = $this->roleId;
             $model->REMARK = $this->remark;

+ 421 - 421
backendApi/modules/v1/models/lists/bonus/BalanceList.php

@@ -1,422 +1,422 @@
-<?php
-namespace backendApi\modules\v1\models\lists\bonus;
-
-use backendApi\modules\v1\models\Admin;
-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\User;
-use common\models\UserBind;
-use common\models\UserBonus;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\models\UserWallet;
-use common\models\Withdraw;
-use Yii;
-
-class BalanceList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '会员奖金余额列表';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle()
-    {
-        $this->condition .= ' AND UI.STATUS=1 AND I.LAST_LOGIN_AT>=1620748800';
-        $this->listData = UserBonus::lists($this->condition, $this->params, [
-            'select' => 'UB.*,UI.*,UW.CASH',
-            'from' => UserBonus::tableName() . ' AS UB',
-            'join' => [
-//                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'UI.USER_ID=UB.USER_ID'],
-                ['LEFT JOIN', User::tableName() . ' AS UI', 'UI.ID=UB.USER_ID'],
-                ['LEFT JOIN', UserWallet::tableName() . ' AS UW', 'UW.USER_ID=UB.USER_ID'],
-                ['LEFT JOIN', UserInfo::tableName() . ' AS I', 'I.USER_ID=UB.USER_ID']
-            ],
-            'orderBy' => 'UB.CREATED_AT ASC, UB.ID ASC',
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-
-//        foreach ($this->listData['list'] as $key => $value) {
-//            $userInfo = Info::baseInfo($value['USER_ID']);
-//            $this->listData['list'][$key] = array_merge($value, $userInfo);
-//            $this->listData['list'][$key]['WITHDRAW_WAIT'] = Withdraw::getWithdrawTotal($value['USER_ID'], Withdraw::STATUS_WAIT_PAID);
-//            $this->listData['list'][$key]['WITHDRAW_FAIL'] = Withdraw::getWithdrawTotal($value['USER_ID'], Withdraw::STATUS_PAID_FALSE);
-//        }
-        //总计
-//        $sumData = UserBonus::find()->select('SUM(BONUS) AS SUM_BONUS,SUM(CF) AS SUM_CF,SUM(LX) AS SUM_LX')
-//            ->from(UserBonus::tableName() . ' AS UB')
-//            ->leftJoin(UserInfo::tableName() . ' AS UI', 'UI.USER_ID=UB.USER_ID')
-//            ->where('1=1 ' . $this->condition, $this->params)->asArray()->one();
-//        $sumData['SUM_WITHDRAW_WAIT'] = Withdraw::getAllWithdrawTotal(Withdraw::STATUS_WAIT_PAID);
-//        $sumData['SUM_WITHDRAW_FAIL'] = Withdraw::getAllWithdrawTotal(Withdraw::STATUS_PAID_FALSE);
-//        $this->listData['sumData'] = $sumData;
-    }
-
-    /**
-     * 要展示和导出的所有字段
-     * @return array
-     */
-    public function getColumn(){
-        if(!$this->columns){
-            $this->columns = [
-                'USER_ID' => null, // 这种传输方式主要是用于索引,因为过滤后的字段可能没有这种ID,但是一些功能的操作还需要用这种ID去关联,例如前台会员列表中的勾选批量状态管理,这里需要的就是USER_ID
-                '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']
-                    ],
-                ],
-//                'DEC_LV_NAME' => [
-//                    'header' => '会员级别',
-//                    'headerOther' => [
-//                        'width' => '110',
-//                    ],
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
-//                    ],
-//                ],
-//                'EMP_LV_NAME' => [
-//                    'header' => '聘级',
-//                    'headerOther' => [
-//                        'width' => '130',
-//                    ],
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
-//                    ],
-//                ],
-                'IS_DEC' => [
-                    'header' => '是否报单中心',
-                    'value' => function($row) {
-                        return (new YesNo([
-                            'value' => $row['IS_DEC'],
-                        ]))->result();
-                    },
-                    'headerOther' => function($row) {
-                        return [
-                            'width' => '120',
-                        ];
-                    },
-                    'valueOther' => function($row) {
-                        return [
-                            'tag'=>['type'=>(isset($row['IS_DEC']) && $row['IS_DEC'] )? 'success' : 'info', 'size' => 'small']
-                        ];
-                    },
-                ],
-//                'DEC_ROLE_NAME' => [
-//                    'header' => '报单中心级别',
-//                    'headerOther' => ['width' => '110'],
-//                ],
-//                'SYSTEM_NAME' => [
-//                    'header' => '体系名称',
-//                    'headerOther' => ['width' => '150'],
-//                ],
-                'BONUS' => [
-                    'header' => '会员奖金余额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['BONUS'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '150',
-                        'prop'=>'BONUS',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
-                    ],
-                ],
-                'RECONSUME_POINTS' => [
-                    'header' => '会员复消积分',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['RECONSUME_POINTS'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '150',
-                        'prop'=>'BONUS',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
-                    ],
-                ],
-                'EXCHANGE_POINTS' => [
-                    'header' => '兑换积分',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['EXCHANGE_POINTS'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '150',
-                        'prop'=>'BONUS',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
-                    ],
-                ],
-                'CASH' => [
-                    'header' => '会员余额',
-                    'value' => function($row) {
-                        return (new Price([
-                            'value' => $row['CASH'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '150',
-                        'prop'=>'BONUS',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
-                    ],
-                ],
-//                'CF' => [
-//                    'header' => '车房养老余额',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['CF'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '150',
-//                        'prop'=>'CF',
-//                    ],
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
-//                    ],
-//                ],
-//                'LX' => [
-//                    'header' => '领袖分红余额',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['LX'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '150',
-//                        'prop'=>'LX',
-//                    ],
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
-//                    ],
-//                ],
-//                'WITHDRAW_WAIT' => [
-//                    'header' => '提现金额',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['WITHDRAW_WAIT'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '150',
-//                        'prop'=>'WITHDRAW_WAIT',
-//                    ],
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border'],
-//                    ],
-//                ],
-//                'TAX' => [
-//                    'header' => '个税',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['WITHDRAW_WAIT'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '150',
-//                        'prop'=>'TAX',
-//                    ],
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border'],
-//                    ],
-//                ],
-//                'DEDUCT' => [
-//                    'header' => '扣款',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['WITHDRAW_WAIT'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '150',
-//                        'prop'=>'DEDUCT',
-//                    ],
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border'],
-//                    ],
-//                ],
-//                'REAL_PAID' => [
-//                    'header' => '实付金额',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['WITHDRAW_WAIT'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '150',
-//                        'prop'=>'REAL_PAID',
-//                    ],
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border'],
-//                    ],
-//                ],
-//                'WITHDRAW_FAIL' => [
-//                    'header' => '实付失败金额',
-//                    'value' => function($row) {
-//                        return (new Price([
-//                            'value' => $row['WITHDRAW_FAIL'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => [
-//                        'width' => '150',
-//                        'prop'=>'WITHDRAW_FAIL',
-//                    ],
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border'],
-//                    ],
-//                ],
-//                'STATUS' => [
-//                    'header' => '会员状态',
-//                    'value' => function($row){
-//                        return Yii::$app->params['userStatus'][$row['STATUS']]['label'];
-//                    },
-//                    'headerOther' => ['width' => '110'],
-//                ],
-//                'STATUS_AT' => [
-//                    'header' => '会员状态变更时间',
-//                    'value' => function($row) {
-//                        return (new DateTime([
-//                            'value' => $row['STATUS_AT'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => ['width' => '170'],
-//                ],
-//                'HIGHEST_EMP_LV_NAME' => [
-//                    'header' => '历史最高聘级',
-//                    'headerOther' => ['width' => '130'],
-//                ],
-                'PERIOD_AT' => '加入期数',
-//                'DEC_DEC_ROLE_NAME' => [
-//                    'header' => '所属报单中心级别',
-//                    'headerOther' => ['width' => '150'],
-//                ],
-//                'DEC_USER_NAME' => [
-//                    'header' => '所属报单中心编号',
-//                    'headerOther' => ['width' => '150'],
-//                ],
-//                'DEC_REAL_NAME' => [
-//                    'header' => '所属报单中心姓名',
-//                    'headerOther' => ['width' => '150'],
-//                ],
-                'MOBILE' => [
-                    'header' => '手机号码',
-                    'value' => function($row) {
-                        return "\t".$row['MOBILE'];
-                    },
-                    'headerOther' => ['width' => '120'],
-                ],
-                'TEL' => [
-                    'header' => '备用手机号码',
-                    'value' => function($row) {
-                        return "\t".$row['TEL'];
-                    },
-                    'headerOther' => ['width' => '120'],
-                ],
-//                'AREA' => [
-//                    'header' => '常用地址',
-//                    'value' => function($row) {
-//                        return $row['PROVINCE_NAME'].$row['CITY_NAME'].$row['COUNTY_NAME'];
-//                    },
-//                    'showValue' => function($row) {
-//                        return '<div class="addr" :title='.$row['PROVINCE_NAME'].$row['CITY_NAME'].$row['COUNTY_NAME'].'>'.$row['PROVINCE_NAME'].$row['CITY_NAME'].$row['COUNTY_NAME'].'</div>';
-//                    },
-//                    'headerOther' => [
-//                        'width' => '200'
-//                    ],
-//                ],
-//                'SUB_COM_NAME' => [
-//                    'header' => '所属分公司',
-//                    'headerOther' => ['width' => '100'],
-//                ],
-//                'IS_DIRECT_SELLER' => [
-//                    'header' => '是否直销员',
-//                    'value' => function($row) {
-//                        return (new YesNo([
-//                            'value' => $row['IS_DIRECT_SELLER'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => function($row) {
-//                        return [
-//                            'width' => '120',
-//                        ];
-//                    },
-//                    'valueOther' => function($row) {
-//                        return [
-//                            'tag'=>['type'=>(isset($row['IS_DIRECT_SELLER']) && $row['IS_DIRECT_SELLER']) ? 'success' : 'info', 'size' => 'small']
-//                        ];
-//                    },
-//                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [
-                'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
-                'REAL_NAME'=> ['isUserTable'=> false, 'name'=> '会员姓名'],
-//                'DEC_LV_NAME'=> ['isUserTable'=> true, 'name'=> '会员级别', 'other'=> 'decLevel'],
-//                'EMP_LV_NAME'=> ['isUserTable'=> true, 'name'=> '聘级', 'other'=> 'empLevel'],
-                'IS_DEC'=> ['isUserTable'=> false, 'name'=> '是否报单中心', 'other'=> 'yesOrNo'],
-//                'DEC_ROLE_NAME'=> ['isUserTable'=> true, 'name'=> '报单中心级别', 'other'=> 'decRole'],
-//                'SYSTEM_NAME'=> ['isUserTable'=> false, 'name'=> '体系名称', 'other'=> 'systems'],
-                'BONUS'=> ['isUserTable'=> false, 'name'=> '会员奖金余额'],
-                'RECONSUME_POINTS'=> ['isUserTable'=> false, 'name'=> '会员复消积分'],
-                'CASH'=> ['isUserTable'=> false, 'name'=> '会员余额'],
-//                'CF'=> ['isUserTable'=> false, 'name'=> '车房养老余额'],
-//                'LX'=> ['isUserTable'=> false, 'name'=> '领袖分红余额'],
-//                'STATUS'=> ['isUserTable'=> true, 'name'=> '会员状态', 'other'=> 'status'],
-//                'STATUS_AT'=> ['isUserTable'=> true, 'name'=> '会员状态变更时间', 'other'=> 'date'],
-//                'HIGHEST_EMP_LV_NAME'=> ['isUserTable'=> false, 'name'=> '历史最高聘级', 'other'=> 'empLevel'],
-                'PERIOD_AT'=> ['isUserTable'=> false, 'name'=> '加入期数'],
-//                'DEC_DEC_ROLE_NAME'=> ['isUserTable'=> true, 'name'=> '所属报单中心级别', 'other'=> 'decRole'],
-//                'DEC_USER_NAME'=> ['isUserTable'=> true, 'name'=> '所属报单中心编号'],
-//                'DEC_REAL_NAME'=> ['isUserTable'=> true, 'name'=> '所属报单中心姓名'],
-                'MOBILE'=> ['isUserTable'=> false, 'name'=> '手机号码'],
-                'TEL'=> ['isUserTable'=> false, 'name'=> '备用手机号码'],
-//                'AREA'=> ['isUserTable'=> true, 'name'=> '常用地址', 'other'=> 'area'],
-//                'SUB_COM_NAME'=> ['isUserTable'=> true, 'name'=> '所属分公司', 'other'=> 'subCompany'],
-//                'IS_DIRECT_SELLER'=> ['isUserTable'=> true, 'name'=> '是否直销员', 'other'=> 'yesOrNo'],
-            ];
-        }
-        return $this->filterTypes;
-    }
+<?php
+namespace backendApi\modules\v1\models\lists\bonus;
+
+use backendApi\modules\v1\models\Admin;
+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\User;
+use common\models\UserBind;
+use common\models\UserBonus;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\models\UserWallet;
+use common\models\Withdraw;
+use Yii;
+
+class BalanceList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '会员奖金余额列表';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle()
+    {
+        $this->condition .= ' AND UI.STATUS=1 AND I.LAST_LOGIN_AT>=1620748800';
+        $this->listData = UserBonus::lists($this->condition, $this->params, [
+            'select' => 'UB.*,UI.*,UW.CASH',
+            'from' => UserBonus::tableName() . ' AS UB',
+            'join' => [
+//                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'UI.USER_ID=UB.USER_ID'],
+                ['LEFT JOIN', User::tableName() . ' AS UI', 'UI.ID=UB.USER_ID'],
+                ['LEFT JOIN', UserWallet::tableName() . ' AS UW', 'UW.USER_ID=UB.USER_ID'],
+                ['LEFT JOIN', UserInfo::tableName() . ' AS I', 'I.USER_ID=UB.USER_ID']
+            ],
+            'orderBy' => 'UB.CREATED_AT ASC, UB.ID ASC',
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+
+//        foreach ($this->listData['list'] as $key => $value) {
+//            $userInfo = Info::baseInfo($value['USER_ID']);
+//            $this->listData['list'][$key] = array_merge($value, $userInfo);
+//            $this->listData['list'][$key]['WITHDRAW_WAIT'] = Withdraw::getWithdrawTotal($value['USER_ID'], Withdraw::STATUS_WAIT_PAID);
+//            $this->listData['list'][$key]['WITHDRAW_FAIL'] = Withdraw::getWithdrawTotal($value['USER_ID'], Withdraw::STATUS_PAID_FALSE);
+//        }
+        //总计
+//        $sumData = UserBonus::find()->select('SUM(BONUS) AS SUM_BONUS,SUM(CF) AS SUM_CF,SUM(LX) AS SUM_LX')
+//            ->from(UserBonus::tableName() . ' AS UB')
+//            ->leftJoin(UserInfo::tableName() . ' AS UI', 'UI.USER_ID=UB.USER_ID')
+//            ->where('1=1 ' . $this->condition, $this->params)->asArray()->one();
+//        $sumData['SUM_WITHDRAW_WAIT'] = Withdraw::getAllWithdrawTotal(Withdraw::STATUS_WAIT_PAID);
+//        $sumData['SUM_WITHDRAW_FAIL'] = Withdraw::getAllWithdrawTotal(Withdraw::STATUS_PAID_FALSE);
+//        $this->listData['sumData'] = $sumData;
+    }
+
+    /**
+     * 要展示和导出的所有字段
+     * @return array
+     */
+    public function getColumn(){
+        if(!$this->columns){
+            $this->columns = [
+                'USER_ID' => null, // 这种传输方式主要是用于索引,因为过滤后的字段可能没有这种ID,但是一些功能的操作还需要用这种ID去关联,例如前台会员列表中的勾选批量状态管理,这里需要的就是USER_ID
+                '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']
+                    ],
+                ],
+//                'DEC_LV_NAME' => [
+//                    'header' => '会员级别',
+//                    'headerOther' => [
+//                        'width' => '110',
+//                    ],
+//                    'valueOther' => [
+//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
+//                    ],
+//                ],
+//                'EMP_LV_NAME' => [
+//                    'header' => '聘级',
+//                    'headerOther' => [
+//                        'width' => '130',
+//                    ],
+//                    'valueOther' => [
+//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
+//                    ],
+//                ],
+                'IS_DEC' => [
+                    'header' => '是否报单中心',
+                    'value' => function($row) {
+                        return (new YesNo([
+                            'value' => $row['IS_DEC'],
+                        ]))->result();
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['IS_DEC']) && $row['IS_DEC'] )? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+//                'DEC_ROLE_NAME' => [
+//                    'header' => '报单中心级别',
+//                    'headerOther' => ['width' => '110'],
+//                ],
+//                'SYSTEM_NAME' => [
+//                    'header' => '体系名称',
+//                    'headerOther' => ['width' => '150'],
+//                ],
+                'BONUS' => [
+                    'header' => '会员奖金余额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['BONUS'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '150',
+                        'prop'=>'BONUS',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
+                    ],
+                ],
+                'RECONSUME_POINTS' => [
+                    'header' => '会员复消积分',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['RECONSUME_POINTS'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '150',
+                        'prop'=>'BONUS',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
+                    ],
+                ],
+                'EXCHANGE_POINTS' => [
+                    'header' => '兑换点数',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['EXCHANGE_POINTS'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '150',
+                        'prop'=>'BONUS',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
+                    ],
+                ],
+                'CASH' => [
+                    'header' => '会员余额',
+                    'value' => function($row) {
+                        return (new Price([
+                            'value' => $row['CASH'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '150',
+                        'prop'=>'BONUS',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
+                    ],
+                ],
+//                'CF' => [
+//                    'header' => '车房养老余额',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['CF'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '150',
+//                        'prop'=>'CF',
+//                    ],
+//                    'valueOther' => [
+//                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
+//                    ],
+//                ],
+//                'LX' => [
+//                    'header' => '领袖分红余额',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['LX'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '150',
+//                        'prop'=>'LX',
+//                    ],
+//                    'valueOther' => [
+//                        'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
+//                    ],
+//                ],
+//                'WITHDRAW_WAIT' => [
+//                    'header' => '提现金额',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['WITHDRAW_WAIT'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '150',
+//                        'prop'=>'WITHDRAW_WAIT',
+//                    ],
+//                    'valueOther' => [
+//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border'],
+//                    ],
+//                ],
+//                'TAX' => [
+//                    'header' => '个税',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['WITHDRAW_WAIT'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '150',
+//                        'prop'=>'TAX',
+//                    ],
+//                    'valueOther' => [
+//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border'],
+//                    ],
+//                ],
+//                'DEDUCT' => [
+//                    'header' => '扣款',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['WITHDRAW_WAIT'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '150',
+//                        'prop'=>'DEDUCT',
+//                    ],
+//                    'valueOther' => [
+//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border'],
+//                    ],
+//                ],
+//                'REAL_PAID' => [
+//                    'header' => '实付金额',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['WITHDRAW_WAIT'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '150',
+//                        'prop'=>'REAL_PAID',
+//                    ],
+//                    'valueOther' => [
+//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border'],
+//                    ],
+//                ],
+//                'WITHDRAW_FAIL' => [
+//                    'header' => '实付失败金额',
+//                    'value' => function($row) {
+//                        return (new Price([
+//                            'value' => $row['WITHDRAW_FAIL'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => [
+//                        'width' => '150',
+//                        'prop'=>'WITHDRAW_FAIL',
+//                    ],
+//                    'valueOther' => [
+//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border'],
+//                    ],
+//                ],
+//                'STATUS' => [
+//                    'header' => '会员状态',
+//                    'value' => function($row){
+//                        return Yii::$app->params['userStatus'][$row['STATUS']]['label'];
+//                    },
+//                    'headerOther' => ['width' => '110'],
+//                ],
+//                'STATUS_AT' => [
+//                    'header' => '会员状态变更时间',
+//                    'value' => function($row) {
+//                        return (new DateTime([
+//                            'value' => $row['STATUS_AT'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => ['width' => '170'],
+//                ],
+//                'HIGHEST_EMP_LV_NAME' => [
+//                    'header' => '历史最高聘级',
+//                    'headerOther' => ['width' => '130'],
+//                ],
+                'PERIOD_AT' => '加入期数',
+//                'DEC_DEC_ROLE_NAME' => [
+//                    'header' => '所属报单中心级别',
+//                    'headerOther' => ['width' => '150'],
+//                ],
+//                'DEC_USER_NAME' => [
+//                    'header' => '所属报单中心编号',
+//                    'headerOther' => ['width' => '150'],
+//                ],
+//                'DEC_REAL_NAME' => [
+//                    'header' => '所属报单中心姓名',
+//                    'headerOther' => ['width' => '150'],
+//                ],
+                'MOBILE' => [
+                    'header' => '手机号码',
+                    'value' => function($row) {
+                        return "\t".$row['MOBILE'];
+                    },
+                    'headerOther' => ['width' => '120'],
+                ],
+                'TEL' => [
+                    'header' => '备用手机号码',
+                    'value' => function($row) {
+                        return "\t".$row['TEL'];
+                    },
+                    'headerOther' => ['width' => '120'],
+                ],
+//                'AREA' => [
+//                    'header' => '常用地址',
+//                    'value' => function($row) {
+//                        return $row['PROVINCE_NAME'].$row['CITY_NAME'].$row['COUNTY_NAME'];
+//                    },
+//                    'showValue' => function($row) {
+//                        return '<div class="addr" :title='.$row['PROVINCE_NAME'].$row['CITY_NAME'].$row['COUNTY_NAME'].'>'.$row['PROVINCE_NAME'].$row['CITY_NAME'].$row['COUNTY_NAME'].'</div>';
+//                    },
+//                    'headerOther' => [
+//                        'width' => '200'
+//                    ],
+//                ],
+//                'SUB_COM_NAME' => [
+//                    'header' => '所属分公司',
+//                    'headerOther' => ['width' => '100'],
+//                ],
+//                'IS_DIRECT_SELLER' => [
+//                    'header' => '是否直销员',
+//                    'value' => function($row) {
+//                        return (new YesNo([
+//                            'value' => $row['IS_DIRECT_SELLER'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => function($row) {
+//                        return [
+//                            'width' => '120',
+//                        ];
+//                    },
+//                    'valueOther' => function($row) {
+//                        return [
+//                            'tag'=>['type'=>(isset($row['IS_DIRECT_SELLER']) && $row['IS_DIRECT_SELLER']) ? 'success' : 'info', 'size' => 'small']
+//                        ];
+//                    },
+//                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [
+                'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
+                'REAL_NAME'=> ['isUserTable'=> false, 'name'=> '会员姓名'],
+//                'DEC_LV_NAME'=> ['isUserTable'=> true, 'name'=> '会员级别', 'other'=> 'decLevel'],
+//                'EMP_LV_NAME'=> ['isUserTable'=> true, 'name'=> '聘级', 'other'=> 'empLevel'],
+                'IS_DEC'=> ['isUserTable'=> false, 'name'=> '是否报单中心', 'other'=> 'yesOrNo'],
+//                'DEC_ROLE_NAME'=> ['isUserTable'=> true, 'name'=> '报单中心级别', 'other'=> 'decRole'],
+//                'SYSTEM_NAME'=> ['isUserTable'=> false, 'name'=> '体系名称', 'other'=> 'systems'],
+                'BONUS'=> ['isUserTable'=> false, 'name'=> '会员奖金余额'],
+                'RECONSUME_POINTS'=> ['isUserTable'=> false, 'name'=> '会员复消积分'],
+                'CASH'=> ['isUserTable'=> false, 'name'=> '会员余额'],
+//                'CF'=> ['isUserTable'=> false, 'name'=> '车房养老余额'],
+//                'LX'=> ['isUserTable'=> false, 'name'=> '领袖分红余额'],
+//                'STATUS'=> ['isUserTable'=> true, 'name'=> '会员状态', 'other'=> 'status'],
+//                'STATUS_AT'=> ['isUserTable'=> true, 'name'=> '会员状态变更时间', 'other'=> 'date'],
+//                'HIGHEST_EMP_LV_NAME'=> ['isUserTable'=> false, 'name'=> '历史最高聘级', 'other'=> 'empLevel'],
+                'PERIOD_AT'=> ['isUserTable'=> false, 'name'=> '加入期数'],
+//                'DEC_DEC_ROLE_NAME'=> ['isUserTable'=> true, 'name'=> '所属报单中心级别', 'other'=> 'decRole'],
+//                'DEC_USER_NAME'=> ['isUserTable'=> true, 'name'=> '所属报单中心编号'],
+//                'DEC_REAL_NAME'=> ['isUserTable'=> true, 'name'=> '所属报单中心姓名'],
+                'MOBILE'=> ['isUserTable'=> false, 'name'=> '手机号码'],
+                'TEL'=> ['isUserTable'=> false, 'name'=> '备用手机号码'],
+//                'AREA'=> ['isUserTable'=> true, 'name'=> '常用地址', 'other'=> 'area'],
+//                'SUB_COM_NAME'=> ['isUserTable'=> true, 'name'=> '所属分公司', 'other'=> 'subCompany'],
+//                'IS_DIRECT_SELLER'=> ['isUserTable'=> true, 'name'=> '是否直销员', 'other'=> 'yesOrNo'],
+            ];
+        }
+        return $this->filterTypes;
+    }
 }

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

@@ -1,207 +1,207 @@
-<?php
-
-namespace backendApi\modules\v1\models\lists\bonus;
-
-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\DealType;
-use common\libs\dataList\column\DateTime;
-use common\models\FlowExchangePoints;
-use Yii;
-
-class FlowExchangePointsList extends \common\libs\dataList\DataList implements DataListInterface {
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName() {
-        return '兑换积分流水';
-    }
-
-    /**
-     * 列表筛选到的数据
-     * @throws \yii\base\Exception
-     */
-    public function dataHandle() {
-        $this->listData = FlowExchangePoints::lists($this->condition, $this->params, [
-            'orderBy' => 'CREATED_AT DESC, ID DESC',
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        foreach ($this->listData['list'] as $key => $value) {
-            $userInfo = Info::baseInfoZh($value['USER_ID']);
-            $this->listData['list'][$key] = array_merge($userInfo, $value);
-            $this->listData['list'][$key]['DEAL_TYPE_NAME'] = DealType::getAllTypesForShow()[$value['DEAL_TYPE_ID']]['TYPE_NAME'] ?? '';
-            $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'] ?? '';
-        }
-    }
-
-    /**
-     * 要展示和导出的所有字段
-     * @return array
-     */
-    public function getColumn() {
-        if (!$this->columns) {
-            $this->columns = [
-                'ID' => null,
-                'CREATED_AT' => [
-                    'header' => '创建时间',
-                    'value' => function ($row) {
-                        return (new DateTime([
-                            'value' => $row['CREATED_AT'],
-                        ]))->result();
-                    },
-                    'headerOther' => ['width' => '170'],
-                ],
-                'PERIOD_NUM' => '期数',
-                'CALC_MONTH' => '结算月',
-                'DEAL_TYPE_NAME' => [
-                    '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_DEC_LV_NAME' => [
-                    'header' => '会员级别',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                    'valueOther' => [
-                        'tag' => ['type' => 'warning', 'size' => 'small', 'class' => 'no-border']
-                    ],
-                ],
-                'LAST_EMP_LV_NAME' => [
-                    'header' => '聘级',
-                    'headerOther' => [
-                        'width' => '130',
-                    ],
-                    'valueOther' => [
-                        'tag' => ['type' => 'warning', 'size' => 'small', 'class' => 'no-border']
-                    ],
-                ],
-                'IS_DEC' => [
-                    'header' => '是否报单中心',
-                    'value' => function ($row) {
-                        return (new YesNo([
-                            'value' => $row['IS_DEC'],
-                        ]))->result();
-                    },
-                    'headerOther' => function ($row) {
-                        return [
-                            'width' => '120',
-                        ];
-                    },
-                    'valueOther' => function ($row) {
-                        return [
-                            'tag' => ['type' => (isset($row['IS_DEC']) && $row['IS_DEC']) ? 'success' : 'info', 'size' => 'small']
-                        ];
-                    },
-                ],
-                'BEFORE_BALANCE' => [
-                    'header' => '交易前余额',
-                    'value' => function ($row) {
-                        return (new Price([
-                            'value' => $row['TOTAL'] - $row['AMOUNT'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'AMOUNT' => [
-                    'header' => '交易额',
-                    'value' => function ($row) {
-                        $result = (new Price([
-                            'value' => $row['AMOUNT'],
-                        ]))->result();
-                        return $row['IS_INCR'] > 0 ? '+' . $result : $result;
-                    },
-                    'headerOther' => [
-                        'width' => '150',
-                        'prop' => 'BONUS',
-                    ],
-                    'valueOther' => function ($row) {
-                        if ($row['IS_INCR'] > 0) {
-                            $type = 'success';
-                        } elseif ($row['IS_INCR'] == 0) {
-                            $type = 'danger';
-                        } else {
-                            $type = 'info';
-                        }
-                        return [
-                            'tag' => ['type' => $type, 'size' => 'small']
-                        ];
-                    },
-                ],
-                'TOTAL' => [
-                    'header' => '交易后余额',
-                    'value' => function ($row) {
-                        return (new Price([
-                            'value' => $row['TOTAL'],
-                        ]))->result();
-                    },
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                ],
-                'ADMIN_NAME' => [
-                    'header' => '操作人',
-                    'headerOther' => ['width' => '110'],
-                ],
-                'REMARK' => [
-                    'header' => '备注',
-                    'headerOther' => ['width' => '250'],
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes() {
-        if (!$this->filterTypes) {
-            $this->filterTypes = [
-                'CREATED_AT' => ['isUserTable' => false, 'name' => '创建时间', 'other' => 'date'],
-                'PERIOD_NUM' => ['isUserTable' => false, 'name' => '期数'],
-                'CALC_MONTH' => ['isUserTable' => false, 'name' => '结算月', 'other' => 'month'],
-                'DEAL_TYPE_NAME' => ['isUserTable' => false, 'name' => '交易类型', 'other' => 'dealTypes'],
-                'USER_NAME' => ['isUserTable' => true, 'name' => '会员编号'],
-                'REAL_NAME' => ['isUserTable' => true, 'name' => '会员姓名'],
-                'LAST_DEC_LV_NAME' => ['isUserTable' => false, 'name' => '会员级别', 'other' => 'decLevel'],
-                'LAST_EMP_LV_NAME' => ['isUserTable' => false, 'name' => '聘级', 'other' => 'empLevel'],
-                'IS_DEC' => ['isUserTable' => true, 'name' => '是否报单中心', 'other' => 'yesOrNo'],
-                'AMOUNT' => ['isUserTable' => false, 'name' => '交易额'],
-                'TOTAL' => ['isUserTable' => false, 'name' => '交易后余额'],
-                'ADMIN_NAME' => ['isUserTable' => false, 'name' => '操作人'],
-                'REMARK' => ['isUserTable' => false, 'name' => '备注'],
-            ];
-        }
-        return $this->filterTypes;
-    }
+<?php
+
+namespace backendApi\modules\v1\models\lists\bonus;
+
+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\DealType;
+use common\libs\dataList\column\DateTime;
+use common\models\FlowExchangePoints;
+use Yii;
+
+class FlowExchangePointsList extends \common\libs\dataList\DataList implements DataListInterface {
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName() {
+        return '兑换点数流水';
+    }
+
+    /**
+     * 列表筛选到的数据
+     * @throws \yii\base\Exception
+     */
+    public function dataHandle() {
+        $this->listData = FlowExchangePoints::lists($this->condition, $this->params, [
+            'orderBy' => 'CREATED_AT DESC, ID DESC',
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        foreach ($this->listData['list'] as $key => $value) {
+            $userInfo = Info::baseInfoZh($value['USER_ID']);
+            $this->listData['list'][$key] = array_merge($userInfo, $value);
+            $this->listData['list'][$key]['DEAL_TYPE_NAME'] = DealType::getAllTypesForShow()[$value['DEAL_TYPE_ID']]['TYPE_NAME'] ?? '';
+            $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'] ?? '';
+        }
+    }
+
+    /**
+     * 要展示和导出的所有字段
+     * @return array
+     */
+    public function getColumn() {
+        if (!$this->columns) {
+            $this->columns = [
+                'ID' => null,
+                'CREATED_AT' => [
+                    'header' => '创建时间',
+                    'value' => function ($row) {
+                        return (new DateTime([
+                            'value' => $row['CREATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+                'PERIOD_NUM' => '期数',
+                'CALC_MONTH' => '结算月',
+                'DEAL_TYPE_NAME' => [
+                    '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_DEC_LV_NAME' => [
+                    'header' => '会员级别',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                    'valueOther' => [
+                        'tag' => ['type' => 'warning', 'size' => 'small', 'class' => 'no-border']
+                    ],
+                ],
+                'LAST_EMP_LV_NAME' => [
+                    'header' => '聘级',
+                    'headerOther' => [
+                        'width' => '130',
+                    ],
+                    'valueOther' => [
+                        'tag' => ['type' => 'warning', 'size' => 'small', 'class' => 'no-border']
+                    ],
+                ],
+                'IS_DEC' => [
+                    'header' => '是否报单中心',
+                    'value' => function ($row) {
+                        return (new YesNo([
+                            'value' => $row['IS_DEC'],
+                        ]))->result();
+                    },
+                    'headerOther' => function ($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function ($row) {
+                        return [
+                            'tag' => ['type' => (isset($row['IS_DEC']) && $row['IS_DEC']) ? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'BEFORE_BALANCE' => [
+                    'header' => '交易前余额',
+                    'value' => function ($row) {
+                        return (new Price([
+                            'value' => $row['TOTAL'] - $row['AMOUNT'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'AMOUNT' => [
+                    'header' => '交易额',
+                    'value' => function ($row) {
+                        $result = (new Price([
+                            'value' => $row['AMOUNT'],
+                        ]))->result();
+                        return $row['IS_INCR'] > 0 ? '+' . $result : $result;
+                    },
+                    'headerOther' => [
+                        'width' => '150',
+                        'prop' => 'BONUS',
+                    ],
+                    'valueOther' => function ($row) {
+                        if ($row['IS_INCR'] > 0) {
+                            $type = 'success';
+                        } elseif ($row['IS_INCR'] == 0) {
+                            $type = 'danger';
+                        } else {
+                            $type = 'info';
+                        }
+                        return [
+                            'tag' => ['type' => $type, 'size' => 'small']
+                        ];
+                    },
+                ],
+                'TOTAL' => [
+                    'header' => '交易后余额',
+                    'value' => function ($row) {
+                        return (new Price([
+                            'value' => $row['TOTAL'],
+                        ]))->result();
+                    },
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'ADMIN_NAME' => [
+                    'header' => '操作人',
+                    'headerOther' => ['width' => '110'],
+                ],
+                'REMARK' => [
+                    'header' => '备注',
+                    'headerOther' => ['width' => '250'],
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes() {
+        if (!$this->filterTypes) {
+            $this->filterTypes = [
+                'CREATED_AT' => ['isUserTable' => false, 'name' => '创建时间', 'other' => 'date'],
+                'PERIOD_NUM' => ['isUserTable' => false, 'name' => '期数'],
+                'CALC_MONTH' => ['isUserTable' => false, 'name' => '结算月', 'other' => 'month'],
+                'DEAL_TYPE_NAME' => ['isUserTable' => false, 'name' => '交易类型', 'other' => 'dealTypes'],
+                'USER_NAME' => ['isUserTable' => true, 'name' => '会员编号'],
+                'REAL_NAME' => ['isUserTable' => true, 'name' => '会员姓名'],
+                'LAST_DEC_LV_NAME' => ['isUserTable' => false, 'name' => '会员级别', 'other' => 'decLevel'],
+                'LAST_EMP_LV_NAME' => ['isUserTable' => false, 'name' => '聘级', 'other' => 'empLevel'],
+                'IS_DEC' => ['isUserTable' => true, 'name' => '是否报单中心', 'other' => 'yesOrNo'],
+                'AMOUNT' => ['isUserTable' => false, 'name' => '交易额'],
+                'TOTAL' => ['isUserTable' => false, 'name' => '交易后余额'],
+                'ADMIN_NAME' => ['isUserTable' => false, 'name' => '操作人'],
+                'REMARK' => ['isUserTable' => false, 'name' => '备注'],
+            ];
+        }
+        return $this->filterTypes;
+    }
 }

+ 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;
+    }
+
 }

+ 2 - 0
backendApi/modules/v1/models/lists/shop/DecOrderList.php

@@ -45,6 +45,7 @@ class DecOrderList extends \common\libs\dataList\DataList implements DataListInt
      */
     public function getColumn(){
         $decLevelConfig = Cache::getDecLevelConfig();
+
         if(!$this->columns){
             $this->columns = [
                 'ID' => null,
@@ -82,6 +83,7 @@ class DecOrderList extends \common\libs\dataList\DataList implements DataListInt
                         'width' => '110',
                     ],
                     'value' => function($row) use($decLevelConfig) {
+
                         return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
                     },
                     'valueOther' => [

+ 623 - 623
backendApi/modules/v1/models/lists/user/IndexList.php

@@ -1,624 +1,624 @@
-<?php
-namespace backendApi\modules\v1\models\lists\user;
-
-use common\helpers\Cache;
-use common\helpers\http\BackendToFrontendApi;
-use common\helpers\user\Info;
-use common\libs\dataList\DataListInterface;
-use common\models\DecRole;
-use common\models\OpenBank;
-use common\models\Region;
-use common\models\User;
-use common\models\UserInfo;
-use common\libs\dataList\column\DateTime;
-use common\libs\dataList\column\YesNo;
-use common\models\UserNetwork;
-use common\models\UserSystem;
-use Yii;
-
-class IndexList extends \common\libs\dataList\DataList implements DataListInterface
-{
-    /**
-     * 列表名称
-     * @return string
-     */
-    public function getListName(){
-        return '会员列表';
-    }
-
-    /**
-     * 列表筛选到的数据
-     */
-    public function dataHandle()
-    {
-        $this->condition .= ' AND UN.USER_ID=UI.USER_ID AND UN.PARENT_UID=UI.CON_UID';
-        $this->listData = User::lists($this->condition, $this->params, [
-            'select' => 'U.*,
-                UI.USER_ID, UI.ZC_PV, UI.CON_UID, UI.REC_UID, UI.CON_NUM, UI.REC_NUM, UI.NETWORK_DEEP, 
-                UI.RELATION_DEEP, UI.SYSTEM_ID, UI.IS_GROUP_LEADER, UI.IS_SYSTEM_LEADER, UI.IS_TEAM, UI.IS_BIND, 
-                UI.IS_TEAM_MAIN, UI.IS_BIND_MAIN, UI.IS_AUTO_WITHDRAW, UI.CLOSE_LOGIN, UI.REG_TYPE, UI.SHOULD_REG_TYPE, 
-                UI.REG_NAME, UI.CREDIT_CODE, UI.PREMISES, UI.LEGAL_PERSON, UI.REG_EXPIRES, UI.STORE_TYPE, UI.INVOICE_BALANCE, 
-                UI.HIGHEST_EMP_LV, UI.CLOSE_LOGIN_AT, UI.PULLED_AT, 
-                UI.GROUP_LEADER_AT, UI.ALLOW_TRANSFER, UI.ALLOW_RECONSUME_SMS, UI.ALLOW_RECONSUME_SMS_TO, 
-                UI.HIGHEST_EMP_LV_PERIOD, UI.TRANSFER_PROP, UI.LOGIN_NUMS, UI.FAIL_NUMS, UI.LAST_LOGIN_IP, 
-                UI.LAST_LOGIN_AT, UI.SHOW_EMP_LV,UN.RELATIVE_LOCATION,
-                CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME,
-                RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,
-                DU.USER_NAME DEC_USER_NAME
-                ',
-            'orderBy' => 'UI.CREATED_AT DESC, UI.ID DESC',
-            'from' => User::tableName() . ' AS U',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'UI.USER_ID=U.ID'],
-                ['LEFT JOIN', UserNetwork::tableName() . ' AS UN', 'UI.USER_ID=UN.USER_ID'],
-                ['LEFT JOIN', User::tableName() . ' AS CU', 'UI.CON_UID=CU.ID'],
-                ['LEFT JOIN', User::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
-                ['LEFT JOIN', User::tableName() . ' AS DU', 'U.DEC_ID=DU.ID'],
-            ],
-            'page' => $this->page,
-            'pageSize' => $this->pageSize,
-        ]);
-        foreach ($this->listData['list'] as $key => $value) {
-            // 后台访问前台的请求参数
-            if (!$this->isExport && Yii::$app->user->validateAdminAction('user', 'login-to-frontend')) {
-                $urlParams = BackendToFrontendApi::paramsFormat(['id' => $value['USER_ID']]);
-                $urlParamStr = '';
-                foreach ($urlParams as $pKey => $pValue) {
-                    $urlParamStr .= $pKey . '=' . $pValue . '&';
-                }
-                $urlParamStr = substr($urlParamStr, 0, -1);
-                $this->listData['list'][$key]['BTF_URL'] = $urlParamStr;
-            } else {
-                $this->listData['list'][$key]['BTF_URL'] = null;
-            }
-        }
-    }
-
-    /**
-     * 要展示和导出的所有字段
-     * @return array
-     */
-    public function getColumn(){
-        $decLevelConfig = Cache::getDecLevelConfig();
-        $empLevelConfig = Cache::getEmpLevelConfig();
-        $decRoleConfig = DecRole::getAllData();
-        $systemConfig = UserSystem::getAllSystems();
-        $openBankConfig = OpenBank::getAllOpenBank();
-        $regionConfig = Cache::getRegionConfig();
-        if(!$this->columns){
-            $this->columns = [
-                'USER_ID' => null, // 这种传输方式主要是用于索引,因为过滤后的字段可能没有这种ID,但是一些功能的操作还需要用这种ID去关联,例如前台会员列表中的勾选批量状态管理,这里需要的就是USER_ID
-                'BTF_URL' => null,
-                'USER_NAME' => [
-                    'header' => '会员编号',
-                    'headerOther' => ['width' => '150'],
-                ],
-                'REAL_NAME' => [
-                    'header' => '会员姓名',
-                    'headerOther' => [
-                        'width' => '120',
-                    ],
-                    'valueOther' => [
-                        'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border']
-                    ],
-                ],
-                'LOGIN_STATUS_NAME' => [
-                    'header' => '登录状态',
-                    'value' => function($row) {
-                        return $row['ALLOW_LOGIN'] == 1 ? '允许登录' : '禁止登录';
-                    },
-                    'headerOther' => ['width' => '110'],
-                ],
-                'STATUS' => [
-                    'header' => '状态',
-                    'value' => function($row) {
-                        return $row['STATUS'] == 1 ? '激活' : '锁定';
-                    },
-                    'headerOther' => ['width' => '110'],
-                ],
-                'ALLOW_LOGIN' => ['header' => '筛选允许登录','hidden'=>true],
-                'CREATED_AT' => [
-                    'header' => '加入日期',
-                    'value' => function($row) {
-                        return (new DateTime([
-                            'value' => $row['CREATED_AT'],
-                        ]))->result();
-                    },
-                    'headerOther' => ['width' => '170'],
-                ],
-                'PERIOD_AT' => '加入期数',
-                'DEC_LV_NAME' => [
-                    'header' => '实时会员级别',
-                    'headerOther' => [
-                        'width' => '110',
-                    ],
-                    'value' => function($row) use($decLevelConfig) {
-                        return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
-                    ],
-                ],
-                'DEC_LV_UPDATED_AT' => [
-                    'header' => '实时调整日期',
-                    'value' => function($row) {
-                        return (new DateTime([
-                            'value' => $row['DEC_LV_UPDATED_AT'],
-                        ]))->result();
-                    },
-                    'headerOther' => ['width' => '170'],
-                ],
-                'LAST_DEC_LV_NAME' => [
-                    'header' => '结算时会员级别',
-                    'headerOther' => [
-                        'width' => '120',
-                    ],
-                    'value' => function($row) use($decLevelConfig) {
-                        if (!$row['LAST_DEC_LV']) {
-                            return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
-                        } else {
-                            return $decLevelConfig[$row['LAST_DEC_LV']]['LEVEL_NAME'];
-                        }
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
-                    ],
-                ],
-                'EMP_LV_NAME' => [
-                    'header' => '实时聘级',
-                    'headerOther' => [
-                        'width' => '130',
-                    ],
-                    'value' => function($row) use($empLevelConfig) {
-                        return isset($empLevelConfig[$row['EMP_LV']])?$empLevelConfig[$row['EMP_LV']]['LEVEL_NAME']:'';
-                    },
-                    'valueOther' => [
-                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
-                    ],
-                ],
-//                'HIGHEST_EMP_LV_NAME' => [
-//                    'header' => '历史最高聘级',
-//                    'value' => function($row) use($empLevelConfig) {
-//                        if (!$row['HIGHEST_EMP_LV']){
-//                            return $empLevelConfig[$row['EMP_LV']]['LEVEL_NAME'];
-//                        } else {
-//                            return $empLevelConfig[$row['HIGHEST_EMP_LV']]['LEVEL_NAME'];
-//                        }
-//                    },
-//                    'headerOther' => ['width' => '130'],
-//                ],
-//                'HIGHEST_EMP_LV_PERIOD' => [
-//                    'header' => '首次达到历史最高聘级的期数',
-//                    'headerOther' => ['width' => '210'],
-//                ],
-                'REC_USER_NAME' => [
-                    'header' => '推荐编号',
-                    'headerOther' => ['width' => '150'],
-                ],
-                'REC_REAL_NAME' => [
-                    'header' => '推荐姓名',
-                    'headerOther' => ['width' => '100'],
-                ],
-                'CON_USER_NAME' => [
-                    'header' => '安置编号',
-                    'headerOther' => ['width' => '150'],
-                ],
-                'CON_REAL_NAME' => [
-                    'header' => '安置姓名',
-                    'headerOther' => ['width' => '100'],
-                ],
-                'RELATIVE_LOCATION' => [
-                    'header' => '安置区域',
-                    'headerOther' => ['width' => '100'],
-                ],
-                'ID_TYPE' => [
-                    'header' => '证件类型',
-                    'value' => function($row) {
-                        return $row['ID_TYPE'] == 0 ? '身份证' : '';
-                    },
-                ],
-                'ID_CARD' => [
-                    'header' => '证件号码',
-                    'value' => function($row) {
-                        return "\t".$row['ID_CARD'];
-                    },
-                    'headerOther' => ['width' => '180'],
-                ],
-//                'SPOUSE_NAME' => [
-//                    'header' => '配偶姓名',
-//                    'headerOther' => ['width' => '100'],
-//                ],
-//                'SPOUSE_IDCARD' => [
-//                    'header' => '配偶身份证号',
-//                    'value' => function($row) {
-//                        return "\t".$row['SPOUSE_IDCARD'];
-//                    },
-//                    'headerOther' => ['width' => '180'],
-//                ],
-//                'SYSTEM_NAME' => [
-//                    'header' => '体系名称',
-//                    'headerOther' => ['width' => '150'],
-//                    'value' => function($row) use($systemConfig) {
-//                        return $systemConfig[$row['SYSTEM_ID']]['SYSTEM_NAME'] ?? '';
-//                    },
-//                ],
-                'MOBILE' => [
-                    'header' => '手机号码',
-                    'value' => function($row) {
-                        return "\t".$row['MOBILE'];
-                    },
-                    'headerOther' => ['width' => '120'],
-                ],
-                'TEL' => [
-                    'header' => '备用手机号码',
-                    'value' => function($row) {
-                        return "\t".$row['TEL'];
-                    },
-                    'headerOther' => ['width' => '120'],
-                ],
-                'DEC_USER_NAME' => [
-                    'header' => '所属报单中心编号',
-                    'headerOther' => ['width' => '150'],
-                ],
-                'IS_DEC' => [
-                    'header' => '是否报单中心',
-                    'value' => function($row) {
-                        return (new YesNo([
-                            'value' => $row['IS_DEC'],
-                        ]))->result();
-                    },
-                    'headerOther' => function($row) {
-                        return [
-                            'width' => '120',
-                        ];
-                    },
-                    'valueOther' => function($row) {
-                        return [
-                            'tag'=>['type'=>(isset($row['IS_DEC']) && $row['IS_DEC'] )? 'success' : 'info', 'size' => 'small']
-                        ];
-                    },
-                ],
-                'IS_STUDIO' => [
-                    'header' => '是否工作室',
-                    'value' => function($row) {
-                        return (new YesNo([
-                            'value' => $row['IS_STUDIO'],
-                        ]))->result();
-                    },
-                    'headerOther' => function($row) {
-                        return [
-                            'width' => '120',
-                        ];
-                    },
-                    'valueOther' => function($row) {
-                        return [
-                            'tag'=>['type'=>(isset($row['IS_STUDIO']) && $row['IS_STUDIO'] )? 'success' : 'info', 'size' => 'small']
-                        ];
-                    },
-                ],
-                'IS_ATLAS' => [
-                    'header' => '是否显示图谱',
-                    'value' => function($row) {
-                        return (new YesNo([
-                            'value' => $row['IS_ATLAS'],
-                        ]))->result();
-                    },
-                    'headerOther' => function($row) {
-                        return [
-                            'width' => '120',
-                        ];
-                    },
-                    'valueOther' => function($row) {
-                        return [
-                            'tag'=>['type'=>(isset($row['IS_ATLAS']) && $row['IS_ATLAS'] )? 'success' : 'info', 'size' => 'small']
-                        ];
-                    },
-                ],
-                'IS_RECHARGE' => [
-                    'header' => '是否显示充值',
-                    'value' => function($row) {
-                        return (new YesNo([
-                            'value' => $row['IS_RECHARGE'],
-                        ]))->result();
-                    },
-                    'headerOther' => function($row) {
-                        return [
-                            'width' => '120',
-                        ];
-                    },
-                    'valueOther' => function($row) {
-                        return [
-                            'tag'=>['type'=>(isset($row['IS_RECHARGE']) && $row['IS_RECHARGE'] )? 'success' : 'info', 'size' => 'small']
-                        ];
-                    },
-                ],
-                'DEC_ROLE_NAME' => [
-                    'header' => '报单中心级别',
-                    'headerOther' => ['width' => '110'],
-                    'value' => function($row) use($decRoleConfig) {
-                        return $decRoleConfig[$row['DEC_ROLE_ID']]['ROLE_NAME'] ?? '';
-                    },
-                ],
-                'OPEN_BANK_NAME' => [
-                    'header' => '开户银行',
-                    'headerOther' => ['width' => '110'],
-                    'value' => function($row) use($openBankConfig) {
-                        return $openBankConfig[$row['OPEN_BANK']]['BANK_NAME'] ?? '';
-                    },
-                ],
-                'BANK_AREA' => [
-                    'header' => '银行地区',
-                    'value' => function($row) use($regionConfig) {
-                        $province = $regionConfig[$row['BANK_PROVINCE']]['REGION_NAME'] ?? '';
-                        $city = $regionConfig[$row['BANK_CITY']]['REGION_NAME'] ?? '';
-                        $county = $regionConfig[$row['BANK_COUNTY']]['REGION_NAME'] ?? '';
-                        return $province.$city.$county;
-                    },
-                    'showValue' => function($row) use($regionConfig) {
-                        $province = $regionConfig[$row['BANK_PROVINCE']]['REGION_NAME'] ?? '';
-                        $city = $regionConfig[$row['BANK_CITY']]['REGION_NAME'] ?? '';
-                        $county = $regionConfig[$row['BANK_COUNTY']]['REGION_NAME'] ?? '';
-                        return '<div class="addr" title='.$province.$city.$county.'>'.$province.$city.$county.'</div>';
-                    },
-                    'headerOther' => [
-                        'width' => '200'
-                    ],
-                ],
-                'BANK_ADDRESS' => [
-                    'header' => '开户地址',
-                    'headerOther' => ['width' => '250'],
-                    'showValue' => function($row) {
-                        return '<div class="addr" title='.$row['BANK_ADDRESS'].'>'.$row['BANK_ADDRESS'].'</div>';
-                    },
-                ],
-                'BANK_NO' => [
-                    'header' => '银行帐号',
-                    'headerOther' => ['width' => '220'],
-                    'value' => function($row) {
-                        return "\t".$row['BANK_NO'];
-                    },
-                ],
-                'SEX' => '性别',
-                'NATION_NAME' => [
-                    'header' => '民族',
-                    'value' => function($row) {
-                        return \Yii::$app->params['nation'][$row['NATION']]['name'] ?? '';
-                    },
-                ],
-                'AREA' => [
-                    'header' => '常用地址',
-                    'value' => function($row) use($regionConfig) {
-                        $province = $regionConfig[$row['PROVINCE']]['REGION_NAME'] ?? '';
-                        $city = $regionConfig[$row['CITY']]['REGION_NAME'] ?? '';
-                        $county = $regionConfig[$row['COUNTY']]['REGION_NAME'] ?? '';
-                        return $province.$city.$county;
-                    },
-                    'showValue' => function($row) {
-                        $province = $regionConfig[$row['PROVINCE']]['REGION_NAME'] ?? '';
-                        $city = $regionConfig[$row['CITY']]['REGION_NAME'] ?? '';
-                        $county = $regionConfig[$row['COUNTY']]['REGION_NAME'] ?? '';
-                        return '<div class="addr" title='.$province.$city.$county.'>'.$province.$city.$county.'</div>';
-                    },
-                    'headerOther' => [
-                        'width' => '200'
-                    ],
-                ],
-                'ADDRESS' => [
-                    'header' => '身份证地址',
-                    'value' => function($row) {
-                        return $row['ADDRESS'];
-                    },
-                    'showValue' => function($row) {
-                        return '<div class="addr" title='.$row['ADDRESS'].'>'.$row['ADDRESS'].'</div>';
-                    },
-                    'headerOther' => ['width' => '250'],
-                ],
-//                'IS_AUTO_WITHDRAW' => [
-//                    'header' => '提现方式',
-//                    'value' => function($row) {
-//                        return $row['IS_AUTO_WITHDRAW']==0?'手动':'自动';
-//                    },
-//                ],
-                'VERIFIED' => [
-                    'header' => '实名认证',
-                    'value' => function($row) {
-                        return (new YesNo([
-                            'value' => $row['VERIFIED'],
-                        ]))->result();
-                    },
-                    'headerOther' => function($row) {
-                        return [
-                            'width' => '120',
-                        ];
-                    },
-                    'valueOther' => function($row) {
-                        return [
-                            'tag'=>['type'=>(isset($row['VERIFIED']) && $row['VERIFIED']) ? 'success' : 'info', 'size' => 'small']
-                        ];
-                    },
-                ],
-                'VERIFIED_AT' => [
-                    'header' => '实名认证日期',
-                    'value' => function($row) {
-                        return (new DateTime([
-                            'value' => $row['VERIFIED_AT'],
-                        ]))->result();
-                    },
-                    'headerOther' => ['width' => '170'],
-                ],
-//                'IS_DIRECT_SELLER' => [
-//                    'header' => '是否直销员',
-//                    'value' => function($row) {
-//                        return (new YesNo([
-//                            'value' => $row['IS_DIRECT_SELLER'],
-//                        ]))->result();
-//                    },
-//                    'valueOther' => function($row) {
-//                        return [
-//                            'tag'=>['type'=>(isset($row['IS_DIRECT_SELLER']) && $row['IS_DIRECT_SELLER']) ? 'success' : 'info', 'size' => 'small']
-//                        ];
-//                    },
-//                    'headerOther' => function($row) {
-//                        return [
-//                            'width' => '120',
-//                        ];
-//                    },
-//                ],
-//                'IS_SYSTEM_LEADER' => [
-//                    'header' => '是否体系领导人',
-//                    'value' => function($row) {
-//                        return (new YesNo([
-//                            'value' => $row['IS_SYSTEM_LEADER'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => function($row) {
-//                        return [
-//                            'width' => '120',
-//                        ];
-//                    },
-//                    'valueOther' => function($row) {
-//                        return [
-//                            'tag'=>['type'=>(isset($row['IS_SYSTEM_LEADER']) && $row['IS_SYSTEM_LEADER']) ? 'success' : 'info', 'size' => 'small']
-//                        ];
-//                    },
-//                ],
-//                'IS_GROUP_LEADER' => [
-//                    'header' => '是否团队领导人',
-//                    'value' => function($row) {
-//                        return (new YesNo([
-//                            'value' => $row['IS_GROUP_LEADER'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => function($row) {
-//                        return [
-//                            'width' => '120',
-//                        ];
-//                    },
-//                    'valueOther' => function($row) {
-//                        return [
-//                            'tag'=>['type'=>(isset($row['IS_GROUP_LEADER']) && $row['IS_GROUP_LEADER'] ) ? 'success' : 'info', 'size' => 'small']
-//                        ];
-//                    },
-//                ],
-                'BIRTHDAY' => [
-                    'header' => '生日',
-                    'value' => function($row) {
-                        return date('Y-m-d', strtotime($row['BIRTHDAY']));
-                    },
-                    'headerOther' => ['width' => '110'],
-                ],
-                'ALLOW_TRANSFER' => [
-                    'header' => '转账功能开启',
-                    'value' => function($row) {
-                        return $row['ALLOW_TRANSFER'] == 1 ? '开启' : '关闭';
-                    },
-                    'headerOther' => function($row) {
-                        return [
-                            'width' => '120',
-                        ];
-                    },
-                    'valueOther' => function($row) {
-                        return [
-                            'tag'=>['type'=>(isset($row['ALLOW_TRANSFER']) && $row['ALLOW_TRANSFER']) ? 'success' : 'info', 'size' => 'small']
-                        ];
-                    },
-                ],
-                'DEC_CLOSED' => [
-                    'header' => '是否关闭报单',
-                    'value' => function($row) {
-                        return (new YesNo([
-                            'value' => $row['DEC_CLOSED'],
-                        ]))->result();
-                    },
-                    'headerOther' => function($row) {
-                        return [
-                            'width' => '120',
-                        ];
-                    },
-                    'valueOther' => function($row) {
-                        return [
-                            'tag'=>['type'=>(isset($row['DEC_CLOSED']) && $row['DEC_CLOSED']) ? 'info' : 'success', 'size' => 'small']
-                        ];
-                    },
-                ],
-                'IS_MODIFY_PASSWORD' => [
-                    'header' => '密码修改状态',
-                    'value' => function($row) {
-                        return $row['IS_MODIFY_PASSWORD'] == 1 ? '开启' : '关闭';
-                    },
-                    'headerOther' => function($row) {
-                        return [
-                            'width' => '120',
-                        ];
-                    },
-                    'valueOther' => function($row) {
-                        return [
-                            'tag'=>['type'=>(isset($row['IS_MODIFY_PASSWORD']) && $row['IS_MODIFY_PASSWORD'] )? 'success' : 'info', 'size' => 'small']
-                        ];
-                    },
-                ],
-            ];
-        }
-        return $this->columns;
-    }
-
-    /**
-     * 前台用于筛选的类型集合
-     * @return mixed
-     */
-    public function getFilterTypes()
-    {
-        if(!$this->filterTypes){
-            $this->filterTypes = [
-                'USER_NAME'=> ['name'=> '会员编号'],
-                'REAL_NAME'=> ['name'=> '会员姓名'],
-//                'ALLOW_LOGIN'=> ['name'=> '允许登录', 'other'=> 'yesOrNo'],
-                'CREATED_AT'=> ['name'=> '加入日期', 'other'=> 'date'],
-                'PERIOD_AT'=> ['name'=> '加入期数'],
-                'DEC_LV_NAME'=> ['name'=> '实时会员级别', 'other'=> 'decLevel'],
-//                'DEC_LV_UPDATED_AT'=> ['name'=> '实时调整日期', 'other'=> 'date'],
-//                'LAST_DEC_LV_NAME'=> ['name'=> '结算时会员级别', 'other'=> 'decLevel'],
-                'EMP_LV_NAME'=> ['name'=> '实时聘级', 'other'=> 'empLevel'],
-//                'HIGHEST_EMP_LV_NAME'=> ['name'=> '历史最高聘级', 'other'=> 'empLevel'],
-//                'HIGHEST_EMP_LV_PERIOD'=> ['name'=> '首次达到历史最高聘级的期数'],
-                'REC_USER_NAME'=> ['name'=> '推荐编号'],
-                'CON_USER_NAME'=> ['name'=> '安置编号'],
-                //'ID_TYPE'=> ['name'=> '证件类型', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '身份证']]],
-                'ID_CARD'=> ['name'=> '证件号码'],
-//                'SPOUSE_NAME'=> ['name'=> '配偶姓名'],
-//                'SPOUSE_IDCARD'=> ['name'=> '配偶身份证号'],
-//                'SYSTEM_NAME'=> ['name'=> '体系名称', 'other'=> 'systems'],
-//                'SUB_COM_NAME'=> ['name'=> '所属分公司', 'other'=> 'subCompany'],
-                'MOBILE'=> ['name'=> '手机号码'],
-//                'TEL'=> ['name'=> '备用手机号码'],
-                'DEC_USER_NAME'=> ['name'=> '所属报单中心编号'],
-                'IS_DEC'=> ['name'=> '是否报单中心', 'other'=> 'yesOrNo'],
-                'IS_STUDIO'=> ['name'=> '是否工作室', 'other'=> 'yesOrNo'],
-                'DEC_ROLE_NAME'=> ['name'=> '报单中心级别', 'other'=> 'decRole'],
-//                'OPEN_BANK_NAME'=> ['name'=> '开户银行', 'other'=> 'banks'],
-//                'BANK_AREA'=> ['name'=> '银行地区', 'other'=> 'area'],
-//                'BANK_ADDRESS'=> ['name'=> '开户地址'],
-//                'BANK_NO'=> ['name'=> '银行账号'],
-//                'SEX'=> ['name'=> '性别', 'other'=> 'sex'],
-//                'NATION_NAME'=> ['name'=> '民族', 'other'=> 'nations'],
-                'AREA'=> ['name'=> '常用地址', 'other'=> 'area'],
-                'STATUS'=> ['name'=> '激活状态', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '锁定'],['id'=> 1, 'name'=> '激活']]],
-//                'ADDRESS'=> ['name'=> '身份证地址'],
-//                'IS_AUTO_WITHDRAW'=> [
-//                    'isUserTable'=> false,
-//                    'name'=> '提现方式',
-//                    'other'=> 'select',
-//                    'selectData'=> [['id'=> 0, 'name'=> '手动'], ['id'=> 1, 'name'=> '自动']]
-//                ],
-//                'VERIFIED'=> ['name'=> '实名认证', 'other'=> 'yesOrNo'],
-//                'VERIFIED_AT'=> ['name'=> '实名认证日期', 'other'=> 'date'],
-//                'IS_DIRECT_SELLER'=> ['name'=> '是否直销员', 'other'=> 'yesOrNo'],
-//                'IS_SYSTEM_LEADER'=> ['name'=> '是否体系领导人', 'other'=> 'yesOrNo'],
-//                'IS_GROUP_LEADER'=> ['name'=> '是否团队领导人', 'other'=> 'yesOrNo'],
-//                'ALLOW_TRANSFER'=> ['name'=> '转账功能开启', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '关闭'],['id'=> 1, 'name'=> '开启']]],
-//                'DEC_CLOSED'=> ['name'=> '是否关闭报单', 'other'=> 'yesOrNo'],
-            ];
-        }
-        return $this->filterTypes;
-    }
+<?php
+namespace backendApi\modules\v1\models\lists\user;
+
+use common\helpers\Cache;
+use common\helpers\http\BackendToFrontendApi;
+use common\helpers\user\Info;
+use common\libs\dataList\DataListInterface;
+use common\models\DecRole;
+use common\models\OpenBank;
+use common\models\Region;
+use common\models\User;
+use common\models\UserInfo;
+use common\libs\dataList\column\DateTime;
+use common\libs\dataList\column\YesNo;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use Yii;
+
+class IndexList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return '会员列表';
+    }
+
+    /**
+     * 列表筛选到的数据
+     */
+    public function dataHandle()
+    {
+        $this->condition .= ' AND UN.USER_ID=UI.USER_ID AND UN.PARENT_UID=UI.CON_UID';
+        $this->listData = User::lists($this->condition, $this->params, [
+            'select' => 'U.*,
+                UI.USER_ID, UI.ZC_PV, UI.CON_UID, UI.REC_UID, UI.CON_NUM, UI.REC_NUM, UI.NETWORK_DEEP, 
+                UI.RELATION_DEEP, UI.SYSTEM_ID, UI.IS_GROUP_LEADER, UI.IS_SYSTEM_LEADER, UI.IS_TEAM, UI.IS_BIND, 
+                UI.IS_TEAM_MAIN, UI.IS_BIND_MAIN, UI.IS_AUTO_WITHDRAW, UI.CLOSE_LOGIN, UI.REG_TYPE, UI.SHOULD_REG_TYPE, 
+                UI.REG_NAME, UI.CREDIT_CODE, UI.PREMISES, UI.LEGAL_PERSON, UI.REG_EXPIRES, UI.STORE_TYPE, UI.INVOICE_BALANCE, 
+                UI.HIGHEST_EMP_LV, UI.CLOSE_LOGIN_AT, UI.PULLED_AT, 
+                UI.GROUP_LEADER_AT, UI.ALLOW_TRANSFER, UI.ALLOW_RECONSUME_SMS, UI.ALLOW_RECONSUME_SMS_TO, 
+                UI.HIGHEST_EMP_LV_PERIOD, UI.TRANSFER_PROP, UI.LOGIN_NUMS, UI.FAIL_NUMS, UI.LAST_LOGIN_IP, 
+                UI.LAST_LOGIN_AT, UI.SHOW_EMP_LV,UN.RELATIVE_LOCATION,
+                CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME,
+                RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,
+                DU.USER_NAME DEC_USER_NAME
+                ',
+            'orderBy' => 'UI.CREATED_AT DESC, UI.ID DESC',
+            'from' => User::tableName() . ' AS U',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'UI.USER_ID=U.ID'],
+                ['LEFT JOIN', UserNetwork::tableName() . ' AS UN', 'UI.USER_ID=UN.USER_ID'],
+                ['LEFT JOIN', User::tableName() . ' AS CU', 'UI.CON_UID=CU.ID'],
+                ['LEFT JOIN', User::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
+                ['LEFT JOIN', User::tableName() . ' AS DU', 'U.DEC_ID=DU.ID'],
+            ],
+            'page' => $this->page,
+            'pageSize' => $this->pageSize,
+        ]);
+        foreach ($this->listData['list'] as $key => $value) {
+            // 后台访问前台的请求参数
+            if (!$this->isExport && Yii::$app->user->validateAdminAction('user', 'login-to-frontend')) {
+                $urlParams = BackendToFrontendApi::paramsFormat(['id' => $value['USER_ID']]);
+                $urlParamStr = '';
+                foreach ($urlParams as $pKey => $pValue) {
+                    $urlParamStr .= $pKey . '=' . $pValue . '&';
+                }
+                $urlParamStr = substr($urlParamStr, 0, -1);
+                $this->listData['list'][$key]['BTF_URL'] = $urlParamStr;
+            } else {
+                $this->listData['list'][$key]['BTF_URL'] = null;
+            }
+        }
+    }
+
+    /**
+     * 要展示和导出的所有字段
+     * @return array
+     */
+    public function getColumn(){
+        $decLevelConfig = Cache::getDecLevelConfig();
+        $empLevelConfig = Cache::getEmpLevelConfig();
+        $decRoleConfig = DecRole::getAllData();
+        $systemConfig = UserSystem::getAllSystems();
+        $openBankConfig = OpenBank::getAllOpenBank();
+        $regionConfig = Cache::getRegionConfig();
+        if(!$this->columns){
+            $this->columns = [
+                'USER_ID' => null, // 这种传输方式主要是用于索引,因为过滤后的字段可能没有这种ID,但是一些功能的操作还需要用这种ID去关联,例如前台会员列表中的勾选批量状态管理,这里需要的就是USER_ID
+                'BTF_URL' => null,
+                'USER_NAME' => [
+                    'header' => '会员编号',
+                    'headerOther' => ['width' => '150'],
+                ],
+                'REAL_NAME' => [
+                    'header' => '会员姓名',
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border']
+                    ],
+                ],
+                'LOGIN_STATUS_NAME' => [
+                    'header' => '登录状态',
+                    'value' => function($row) {
+                        return $row['ALLOW_LOGIN'] == 1 ? '允许登录' : '禁止登录';
+                    },
+                    'headerOther' => ['width' => '110'],
+                ],
+                'STATUS' => [
+                    'header' => '状态',
+                    'value' => function($row) {
+                        return $row['STATUS'] == 1 ? '激活' : '锁定';
+                    },
+                    'headerOther' => ['width' => '110'],
+                ],
+                'ALLOW_LOGIN' => ['header' => '筛选允许登录','hidden'=>true],
+                'CREATED_AT' => [
+                    'header' => '加入日期',
+                    'value' => function($row) {
+                        return (new DateTime([
+                            'value' => $row['CREATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+                'PERIOD_AT' => '加入期数',
+                'DEC_LV_NAME' => [
+                    'header' => '实时会员级别',
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                    'value' => function($row) use($decLevelConfig) {
+                        return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
+                    ],
+                ],
+                'DEC_LV_UPDATED_AT' => [
+                    'header' => '实时调整日期',
+                    'value' => function($row) {
+                        return (new DateTime([
+                            'value' => $row['DEC_LV_UPDATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+                'LAST_DEC_LV_NAME' => [
+                    'header' => '结算时会员级别',
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                    'value' => function($row) use($decLevelConfig) {
+                        if (!$row['LAST_DEC_LV']) {
+                            return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
+                        } else {
+                            return $decLevelConfig[$row['LAST_DEC_LV']]['LEVEL_NAME'];
+                        }
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
+                    ],
+                ],
+                'EMP_LV_NAME' => [
+                    'header' => '最高聘级',
+                    'headerOther' => [
+                        'width' => '130',
+                    ],
+                    'value' => function($row) use($empLevelConfig) {
+                        return isset($empLevelConfig[$row['EMP_LV']])?$empLevelConfig[$row['EMP_LV']]['LEVEL_NAME']:'';
+                    },
+                    'valueOther' => [
+                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
+                    ],
+                ],
+//                'HIGHEST_EMP_LV_NAME' => [
+//                    'header' => '历史最高聘级',
+//                    'value' => function($row) use($empLevelConfig) {
+//                        if (!$row['HIGHEST_EMP_LV']){
+//                            return $empLevelConfig[$row['EMP_LV']]['LEVEL_NAME'];
+//                        } else {
+//                            return $empLevelConfig[$row['HIGHEST_EMP_LV']]['LEVEL_NAME'];
+//                        }
+//                    },
+//                    'headerOther' => ['width' => '130'],
+//                ],
+//                'HIGHEST_EMP_LV_PERIOD' => [
+//                    'header' => '首次达到历史最高聘级的期数',
+//                    'headerOther' => ['width' => '210'],
+//                ],
+                'REC_USER_NAME' => [
+                    'header' => '推荐编号',
+                    'headerOther' => ['width' => '150'],
+                ],
+                'REC_REAL_NAME' => [
+                    'header' => '推荐姓名',
+                    'headerOther' => ['width' => '100'],
+                ],
+                'CON_USER_NAME' => [
+                    'header' => '安置编号',
+                    'headerOther' => ['width' => '150'],
+                ],
+                'CON_REAL_NAME' => [
+                    'header' => '安置姓名',
+                    'headerOther' => ['width' => '100'],
+                ],
+                'RELATIVE_LOCATION' => [
+                    'header' => '安置区域',
+                    'headerOther' => ['width' => '100'],
+                ],
+                'ID_TYPE' => [
+                    'header' => '证件类型',
+                    'value' => function($row) {
+                        return $row['ID_TYPE'] == 0 ? '身份证' : '';
+                    },
+                ],
+                'ID_CARD' => [
+                    'header' => '证件号码',
+                    'value' => function($row) {
+                        return "\t".$row['ID_CARD'];
+                    },
+                    'headerOther' => ['width' => '180'],
+                ],
+//                'SPOUSE_NAME' => [
+//                    'header' => '配偶姓名',
+//                    'headerOther' => ['width' => '100'],
+//                ],
+//                'SPOUSE_IDCARD' => [
+//                    'header' => '配偶身份证号',
+//                    'value' => function($row) {
+//                        return "\t".$row['SPOUSE_IDCARD'];
+//                    },
+//                    'headerOther' => ['width' => '180'],
+//                ],
+//                'SYSTEM_NAME' => [
+//                    'header' => '体系名称',
+//                    'headerOther' => ['width' => '150'],
+//                    'value' => function($row) use($systemConfig) {
+//                        return $systemConfig[$row['SYSTEM_ID']]['SYSTEM_NAME'] ?? '';
+//                    },
+//                ],
+                'MOBILE' => [
+                    'header' => '手机号码',
+                    'value' => function($row) {
+                        return "\t".$row['MOBILE'];
+                    },
+                    'headerOther' => ['width' => '120'],
+                ],
+                'TEL' => [
+                    'header' => '备用手机号码',
+                    'value' => function($row) {
+                        return "\t".$row['TEL'];
+                    },
+                    'headerOther' => ['width' => '120'],
+                ],
+                'DEC_USER_NAME' => [
+                    'header' => '所属报单中心编号',
+                    'headerOther' => ['width' => '150'],
+                ],
+                'IS_DEC' => [
+                    'header' => '是否报单中心',
+                    'value' => function($row) {
+                        return (new YesNo([
+                            'value' => $row['IS_DEC'],
+                        ]))->result();
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['IS_DEC']) && $row['IS_DEC'] )? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'IS_STUDIO' => [
+                    'header' => '是否工作室',
+                    'value' => function($row) {
+                        return (new YesNo([
+                            'value' => $row['IS_STUDIO'],
+                        ]))->result();
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['IS_STUDIO']) && $row['IS_STUDIO'] )? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'IS_ATLAS' => [
+                    'header' => '是否显示图谱',
+                    'value' => function($row) {
+                        return (new YesNo([
+                            'value' => $row['IS_ATLAS'],
+                        ]))->result();
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['IS_ATLAS']) && $row['IS_ATLAS'] )? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'IS_RECHARGE' => [
+                    'header' => '是否显示充值',
+                    'value' => function($row) {
+                        return (new YesNo([
+                            'value' => $row['IS_RECHARGE'],
+                        ]))->result();
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['IS_RECHARGE']) && $row['IS_RECHARGE'] )? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'DEC_ROLE_NAME' => [
+                    'header' => '报单中心级别',
+                    'headerOther' => ['width' => '110'],
+                    'value' => function($row) use($decRoleConfig) {
+                        return $decRoleConfig[$row['DEC_ROLE_ID']]['ROLE_NAME'] ?? '';
+                    },
+                ],
+                'OPEN_BANK_NAME' => [
+                    'header' => '开户银行',
+                    'headerOther' => ['width' => '110'],
+                    'value' => function($row) use($openBankConfig) {
+                        return $openBankConfig[$row['OPEN_BANK']]['BANK_NAME'] ?? '';
+                    },
+                ],
+                'BANK_AREA' => [
+                    'header' => '银行地区',
+                    'value' => function($row) use($regionConfig) {
+                        $province = $regionConfig[$row['BANK_PROVINCE']]['REGION_NAME'] ?? '';
+                        $city = $regionConfig[$row['BANK_CITY']]['REGION_NAME'] ?? '';
+                        $county = $regionConfig[$row['BANK_COUNTY']]['REGION_NAME'] ?? '';
+                        return $province.$city.$county;
+                    },
+                    'showValue' => function($row) use($regionConfig) {
+                        $province = $regionConfig[$row['BANK_PROVINCE']]['REGION_NAME'] ?? '';
+                        $city = $regionConfig[$row['BANK_CITY']]['REGION_NAME'] ?? '';
+                        $county = $regionConfig[$row['BANK_COUNTY']]['REGION_NAME'] ?? '';
+                        return '<div class="addr" title='.$province.$city.$county.'>'.$province.$city.$county.'</div>';
+                    },
+                    'headerOther' => [
+                        'width' => '200'
+                    ],
+                ],
+                'BANK_ADDRESS' => [
+                    'header' => '开户地址',
+                    'headerOther' => ['width' => '250'],
+                    'showValue' => function($row) {
+                        return '<div class="addr" title='.$row['BANK_ADDRESS'].'>'.$row['BANK_ADDRESS'].'</div>';
+                    },
+                ],
+                'BANK_NO' => [
+                    'header' => '银行帐号',
+                    'headerOther' => ['width' => '220'],
+                    'value' => function($row) {
+                        return "\t".$row['BANK_NO'];
+                    },
+                ],
+                'SEX' => '性别',
+                'NATION_NAME' => [
+                    'header' => '民族',
+                    'value' => function($row) {
+                        return \Yii::$app->params['nation'][$row['NATION']]['name'] ?? '';
+                    },
+                ],
+                'AREA' => [
+                    'header' => '常用地址',
+                    'value' => function($row) use($regionConfig) {
+                        $province = $regionConfig[$row['PROVINCE']]['REGION_NAME'] ?? '';
+                        $city = $regionConfig[$row['CITY']]['REGION_NAME'] ?? '';
+                        $county = $regionConfig[$row['COUNTY']]['REGION_NAME'] ?? '';
+                        return $province.$city.$county;
+                    },
+                    'showValue' => function($row) {
+                        $province = $regionConfig[$row['PROVINCE']]['REGION_NAME'] ?? '';
+                        $city = $regionConfig[$row['CITY']]['REGION_NAME'] ?? '';
+                        $county = $regionConfig[$row['COUNTY']]['REGION_NAME'] ?? '';
+                        return '<div class="addr" title='.$province.$city.$county.'>'.$province.$city.$county.'</div>';
+                    },
+                    'headerOther' => [
+                        'width' => '200'
+                    ],
+                ],
+                'ADDRESS' => [
+                    'header' => '身份证地址',
+                    'value' => function($row) {
+                        return $row['ADDRESS'];
+                    },
+                    'showValue' => function($row) {
+                        return '<div class="addr" title='.$row['ADDRESS'].'>'.$row['ADDRESS'].'</div>';
+                    },
+                    'headerOther' => ['width' => '250'],
+                ],
+//                'IS_AUTO_WITHDRAW' => [
+//                    'header' => '提现方式',
+//                    'value' => function($row) {
+//                        return $row['IS_AUTO_WITHDRAW']==0?'手动':'自动';
+//                    },
+//                ],
+                'VERIFIED' => [
+                    'header' => '实名认证',
+                    'value' => function($row) {
+                        return (new YesNo([
+                            'value' => $row['VERIFIED'],
+                        ]))->result();
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['VERIFIED']) && $row['VERIFIED']) ? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'VERIFIED_AT' => [
+                    'header' => '实名认证日期',
+                    'value' => function($row) {
+                        return (new DateTime([
+                            'value' => $row['VERIFIED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+//                'IS_DIRECT_SELLER' => [
+//                    'header' => '是否直销员',
+//                    'value' => function($row) {
+//                        return (new YesNo([
+//                            'value' => $row['IS_DIRECT_SELLER'],
+//                        ]))->result();
+//                    },
+//                    'valueOther' => function($row) {
+//                        return [
+//                            'tag'=>['type'=>(isset($row['IS_DIRECT_SELLER']) && $row['IS_DIRECT_SELLER']) ? 'success' : 'info', 'size' => 'small']
+//                        ];
+//                    },
+//                    'headerOther' => function($row) {
+//                        return [
+//                            'width' => '120',
+//                        ];
+//                    },
+//                ],
+//                'IS_SYSTEM_LEADER' => [
+//                    'header' => '是否体系领导人',
+//                    'value' => function($row) {
+//                        return (new YesNo([
+//                            'value' => $row['IS_SYSTEM_LEADER'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => function($row) {
+//                        return [
+//                            'width' => '120',
+//                        ];
+//                    },
+//                    'valueOther' => function($row) {
+//                        return [
+//                            'tag'=>['type'=>(isset($row['IS_SYSTEM_LEADER']) && $row['IS_SYSTEM_LEADER']) ? 'success' : 'info', 'size' => 'small']
+//                        ];
+//                    },
+//                ],
+//                'IS_GROUP_LEADER' => [
+//                    'header' => '是否团队领导人',
+//                    'value' => function($row) {
+//                        return (new YesNo([
+//                            'value' => $row['IS_GROUP_LEADER'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => function($row) {
+//                        return [
+//                            'width' => '120',
+//                        ];
+//                    },
+//                    'valueOther' => function($row) {
+//                        return [
+//                            'tag'=>['type'=>(isset($row['IS_GROUP_LEADER']) && $row['IS_GROUP_LEADER'] ) ? 'success' : 'info', 'size' => 'small']
+//                        ];
+//                    },
+//                ],
+                'BIRTHDAY' => [
+                    'header' => '生日',
+                    'value' => function($row) {
+                        return date('Y-m-d', strtotime($row['BIRTHDAY']));
+                    },
+                    'headerOther' => ['width' => '110'],
+                ],
+                'ALLOW_TRANSFER' => [
+                    'header' => '转账功能开启',
+                    'value' => function($row) {
+                        return $row['ALLOW_TRANSFER'] == 1 ? '开启' : '关闭';
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['ALLOW_TRANSFER']) && $row['ALLOW_TRANSFER']) ? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'DEC_CLOSED' => [
+                    'header' => '是否关闭报单',
+                    'value' => function($row) {
+                        return (new YesNo([
+                            'value' => $row['DEC_CLOSED'],
+                        ]))->result();
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['DEC_CLOSED']) && $row['DEC_CLOSED']) ? 'info' : 'success', 'size' => 'small']
+                        ];
+                    },
+                ],
+                'IS_MODIFY_PASSWORD' => [
+                    'header' => '密码修改状态',
+                    'value' => function($row) {
+                        return $row['IS_MODIFY_PASSWORD'] == 1 ? '开启' : '关闭';
+                    },
+                    'headerOther' => function($row) {
+                        return [
+                            'width' => '120',
+                        ];
+                    },
+                    'valueOther' => function($row) {
+                        return [
+                            'tag'=>['type'=>(isset($row['IS_MODIFY_PASSWORD']) && $row['IS_MODIFY_PASSWORD'] )? 'success' : 'info', 'size' => 'small']
+                        ];
+                    },
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [
+                'USER_NAME'=> ['name'=> '会员编号'],
+                'REAL_NAME'=> ['name'=> '会员姓名'],
+//                'ALLOW_LOGIN'=> ['name'=> '允许登录', 'other'=> 'yesOrNo'],
+                'CREATED_AT'=> ['name'=> '加入日期', 'other'=> 'date'],
+                'PERIOD_AT'=> ['name'=> '加入期数'],
+                'DEC_LV_NAME'=> ['name'=> '实时会员级别', 'other'=> 'decLevel'],
+//                'DEC_LV_UPDATED_AT'=> ['name'=> '实时调整日期', 'other'=> 'date'],
+//                'LAST_DEC_LV_NAME'=> ['name'=> '结算时会员级别', 'other'=> 'decLevel'],
+                'EMP_LV_NAME'=> ['name'=> '最高聘级', 'other'=> 'empLevel'],
+//                'HIGHEST_EMP_LV_NAME'=> ['name'=> '历史最高聘级', 'other'=> 'empLevel'],
+//                'HIGHEST_EMP_LV_PERIOD'=> ['name'=> '首次达到历史最高聘级的期数'],
+                'REC_USER_NAME'=> ['name'=> '推荐编号'],
+                'CON_USER_NAME'=> ['name'=> '安置编号'],
+                //'ID_TYPE'=> ['name'=> '证件类型', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '身份证']]],
+                'ID_CARD'=> ['name'=> '证件号码'],
+//                'SPOUSE_NAME'=> ['name'=> '配偶姓名'],
+//                'SPOUSE_IDCARD'=> ['name'=> '配偶身份证号'],
+//                'SYSTEM_NAME'=> ['name'=> '体系名称', 'other'=> 'systems'],
+//                'SUB_COM_NAME'=> ['name'=> '所属分公司', 'other'=> 'subCompany'],
+                'MOBILE'=> ['name'=> '手机号码'],
+//                'TEL'=> ['name'=> '备用手机号码'],
+                'DEC_USER_NAME'=> ['name'=> '所属报单中心编号'],
+                'IS_DEC'=> ['name'=> '是否报单中心', 'other'=> 'yesOrNo'],
+                'IS_STUDIO'=> ['name'=> '是否工作室', 'other'=> 'yesOrNo'],
+                'DEC_ROLE_NAME'=> ['name'=> '报单中心级别', 'other'=> 'decRole'],
+//                'OPEN_BANK_NAME'=> ['name'=> '开户银行', 'other'=> 'banks'],
+//                'BANK_AREA'=> ['name'=> '银行地区', 'other'=> 'area'],
+//                'BANK_ADDRESS'=> ['name'=> '开户地址'],
+//                'BANK_NO'=> ['name'=> '银行账号'],
+//                'SEX'=> ['name'=> '性别', 'other'=> 'sex'],
+//                'NATION_NAME'=> ['name'=> '民族', 'other'=> 'nations'],
+                'AREA'=> ['name'=> '常用地址', 'other'=> 'area'],
+                'STATUS'=> ['name'=> '激活状态', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '锁定'],['id'=> 1, 'name'=> '激活']]],
+//                'ADDRESS'=> ['name'=> '身份证地址'],
+//                'IS_AUTO_WITHDRAW'=> [
+//                    'isUserTable'=> false,
+//                    'name'=> '提现方式',
+//                    'other'=> 'select',
+//                    'selectData'=> [['id'=> 0, 'name'=> '手动'], ['id'=> 1, 'name'=> '自动']]
+//                ],
+//                'VERIFIED'=> ['name'=> '实名认证', 'other'=> 'yesOrNo'],
+//                'VERIFIED_AT'=> ['name'=> '实名认证日期', 'other'=> 'date'],
+//                'IS_DIRECT_SELLER'=> ['name'=> '是否直销员', 'other'=> 'yesOrNo'],
+//                'IS_SYSTEM_LEADER'=> ['name'=> '是否体系领导人', 'other'=> 'yesOrNo'],
+//                'IS_GROUP_LEADER'=> ['name'=> '是否团队领导人', 'other'=> 'yesOrNo'],
+//                'ALLOW_TRANSFER'=> ['name'=> '转账功能开启', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '关闭'],['id'=> 1, 'name'=> '开启']]],
+//                'DEC_CLOSED'=> ['name'=> '是否关闭报单', 'other'=> 'yesOrNo'],
+            ];
+        }
+        return $this->filterTypes;
+    }
 }

+ 1 - 1
backendEle/src/router/index.js

@@ -783,7 +783,7 @@ export const constantRouterMap = [
         component: _import('bonus/flow-exchange'),
         name: 'bonus_flow-exchange',
         meta: {
-          title: '兑换积分流水',
+          title: '兑换点数流水',
           breadcrumb: [
             {title: '首页', path: '/dashboard/index'},
             {title: '奖金管理', path: '/bonus/period'},

+ 253 - 253
backendEle/src/utils/network.js

@@ -1,253 +1,253 @@
-import {ACCESS_TOKEN_PREFIX} from './config'
-import userInfo from './userInfo'
-import tool from './tool'
-import axiosObj from './axiosPlugin'
-import ElementUI from 'element-ui'
-import baseInfo from './baseInfo'
-
-const updateToken = function (callback, errorBack) {
-  if (!userInfo.hasLogin()) {
-    //console.log('尚未登录');
-    //userInfo.clear();
-    errorBack('E40004')
-    return false
-  }
-  // 比较本地accessToken是否还有效
-  if (userInfo.accessToken() && userInfo.accessTokenExpiresIn() && parseInt(userInfo.accessTokenExpiresIn()) + parseInt(userInfo.accessTokenUpdateAt()) - 30 > parseInt(tool.getTimestamp())) {
-    // 有效
-    //console.log('accessToken有效');
-    callback(userInfo.accessToken())
-    return true
-  } else {
-    // 已失效,去更新
-    let refreshToken = userInfo.refreshToken()
-    let refreshTokenExpiresIn = userInfo.refreshTokenExpiresIn()
-    let refreshTokenUpdateAt = userInfo.refreshTokenUpdateAt()
-    if (refreshToken && refreshTokenExpiresIn && parseInt(refreshTokenExpiresIn) - 30 + parseInt(refreshTokenUpdateAt) > parseInt(tool.getTimestamp())) {
-      // 有效,去更新
-      axiosObj.get(`oauth/refresh-token?refresh-token=${refreshToken}`).then(response => {
-        // 更新本地accessToken
-        userInfo.accessToken(response.accessToken)
-        userInfo.accessTokenExpiresIn(response.accessTokenExpiresIn)
-        userInfo.accessTokenUpdateAt(response.accessTokenUpdateAt)
-        userInfo.refreshToken(response.refreshToken)
-        userInfo.refreshTokenExpiresIn(response.refreshTokenExpiresIn)
-        userInfo.refreshTokenUpdateAt(response.refreshTokenUpdateAt)
-        // 成功
-        //console.log('accessToken更新成功,refreshToken更新为:'+userInfo.refreshToken());
-        //console.log('accessToken更新成功,refreshToken的更新时间为:'+tool.formatDate(userInfo.refreshTokenUpdateAt()));
-        //console.log('accessToken更新成功,refreshToken的有效时间为:'+userInfo.refreshTokenExpiresIn());
-        callback(userInfo.accessToken())
-        return true
-      }).catch(error => {
-        //userInfo.clear();
-        //console.log(error);
-        errorBack('E40001')
-        return false
-      })
-    } else {
-      //console.log('refreshToken已失效');
-      userInfo.clear()
-      // 失效
-      errorBack('E40003')
-      return false
-    }
-  }
-}
-
-const network = {
-  loginGetAccessToken(adminName, password, verifyCode, pageId) {
-    let promise = new Promise((resolve, reject) => {
-      // if(userInfo.hasLogin()){
-      //     reject('E40005');
-      //     return false;
-      // }
-      axiosObj.post(`oauth/login?page_id=${pageId}`, {
-        LoginForm: {
-          adminName,
-          password,
-          verifyCode,
-        }
-      }).then(response => {
-        // 更新本地accessToken
-        userInfo.updateLoginAllInfo(response)
-        // 成功
-        resolve(response)
-      }).catch(error => {
-        //console.log('登录获取数据错误');
-        userInfo.clear()
-        reject(error)
-      })
-    })
-    return promise
-  },
-  updateToken() {
-    let promise = new Promise((resolve, reject) => {
-      updateToken(function (accessToken) {
-        resolve(accessToken)
-      }, function (error) {
-        reject(error)
-      })
-    })
-    return promise
-  },
-  getUserInfo() {
-    let promise = new Promise((resolve, reject) => {
-      updateToken(function (accessToken) {
-        axiosObj.get(`oauth/info`, {
-          headers: {
-            'Authorization': ACCESS_TOKEN_PREFIX + accessToken,
-          }
-        }).then(response => {
-          // 更新本地userInfo
-          userInfo.userId(response.ID)
-          userInfo.adminName(response.ADMIN_NAME)
-          userInfo.baseData({roleId: response.ROLE_ID})
-          // 成功
-          resolve(response)
-        }).catch(error => {
-          reject(error)
-        })
-      }, function (error) {
-        reject(error)
-      })
-    })
-    return promise
-  },
-  getBaseInfo() {
-    let promise = new Promise((resolve, reject) => {
-      updateToken(function (accessToken) {
-        axiosObj.get(`site/base-info`, {
-          headers: {
-            'Authorization': ACCESS_TOKEN_PREFIX + accessToken,
-          }
-        }).then(response => {
-          // 更新本地baseInfo
-          baseInfo.set(response)
-          // 成功
-          resolve(response)
-        }).catch(error => {
-          reject(error)
-        })
-      }, function (error) {
-        reject(error)
-      })
-    })
-    return promise
-  },
-  getData(route, data = null) {
-    if (data === null) {
-      data = {}
-    }
-    let promise = new Promise((resolve, reject) => {
-      updateToken(function (accessToken) {
-        axiosObj.get(`${route}`, {
-          params: data,
-          headers: {
-            'Authorization': ACCESS_TOKEN_PREFIX + accessToken,
-          }
-        }).then(response => {
-          // 成功
-          resolve(response)
-        }).catch(error => {
-          error = tool.errorHandle(error)
-          ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
-          reject(error)
-        })
-      }, function (error) {
-        error = tool.errorHandle(error)
-        ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
-        reject(error)
-      })
-    })
-    return promise
-  },
-  postData(route, data) {
-    let promise = new Promise((resolve, reject) => {
-      updateToken(function (accessToken) {
-        axiosObj.post(`${route}`, data, {
-          headers: {
-            'Authorization': ACCESS_TOKEN_PREFIX + accessToken,
-          }
-        }).then(response => {
-          // 成功
-          resolve(response)
-        }).catch(error => {
-          error = tool.errorHandle(error)
-          ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
-          reject(error)
-        })
-      }, function (error) {
-        error = tool.errorHandle(error)
-        ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
-        reject(error)
-      })
-    })
-    return promise
-  },
-  getPageData(obj, path, page = null, pageSize = null, data = null, callback = null, isLoading = null, percentFieldName = null) {
-    if (isLoading === false) {
-      obj.loading = isLoading
-    } else {
-      obj.loading = true
-    }
-    if (page === null) page = 1
-    if (pageSize === null) pageSize = 20
-    let paramsData = {
-      page: page,
-      pageSize: pageSize,
-    }
-    if (data === null || tool.isEmptyObject(data)) {
-      // 查看地址栏中的内容,如果有内容则把地址栏中的参数给拿到
-      if(window.location.href.indexOf('filter') !== -1){
-        let nowUrl = tool.parseURL(window.location.href)
-        if(nowUrl.params.filter){
-          data = JSON.parse(unescape(nowUrl.params.filter))
-          if(obj.filterModel){
-            obj.filterModel = data
-          }
-        }
-      }
-    }
-    paramsData = Object.assign(paramsData, data)
-    network.getData(path, paramsData).then(response => {
-      obj.tableData = response.list
-      obj.tableHeaders = response.columnsShow ? response.columnsShow : []
-      obj.loading = false
-      obj.currentPage = page
-      obj.totalPages = parseInt(response.totalPages)
-      obj.totalCount = parseInt(response.totalCount)
-      obj.pageSize = pageSize
-      if (percentFieldName !== null) {
-        if(percentFieldName.length > 0){
-          for(let i in obj.tableData){
-            for(let j in percentFieldName){
-              obj.$set(obj.percentList[percentFieldName[j]], obj.tableData[i].ID, obj.tableData[i][percentFieldName[j]])
-            }
-          }
-        }
-      }
-      if (callback !== null) {
-        callback(response)
-      }
-    }).catch(response => {
-      obj.loading = false
-    })
-  },
-  getDaysDiff() {
-    let promise = new Promise((resolve, reject) => {
-      axiosObj.get(`site/days-diff`).then(response => {
-        // 更新本地baseInfo
-        baseInfo.setDaysDiff(response.daysDiff)
-        // 成功
-        resolve(response)
-      }).catch(error => {
-        reject(error)
-      })
-    })
-    return promise
-  }
-
-}
-
-export default network
+import {ACCESS_TOKEN_PREFIX} from './config'
+import userInfo from './userInfo'
+import tool from './tool'
+import axiosObj from './axiosPlugin'
+import ElementUI from 'element-ui'
+import baseInfo from './baseInfo'
+
+const updateToken = function (callback, errorBack) {
+  if (!userInfo.hasLogin()) {
+    //console.log('尚未登录');
+    //userInfo.clear();
+    errorBack('E40004')
+    return false
+  }
+  // 比较本地accessToken是否还有效
+  if (userInfo.accessToken() && userInfo.accessTokenExpiresIn() && parseInt(userInfo.accessTokenExpiresIn()) + parseInt(userInfo.accessTokenUpdateAt()) - 30 > parseInt(tool.getTimestamp())) {
+    // 有效
+    //console.log('accessToken有效');
+    callback(userInfo.accessToken())
+    return true
+  } else {
+    // 已失效,去更新
+    let refreshToken = userInfo.refreshToken()
+    let refreshTokenExpiresIn = userInfo.refreshTokenExpiresIn()
+    let refreshTokenUpdateAt = userInfo.refreshTokenUpdateAt()
+    if (refreshToken && refreshTokenExpiresIn && parseInt(refreshTokenExpiresIn) - 30 + parseInt(refreshTokenUpdateAt) > parseInt(tool.getTimestamp())) {
+      // 有效,去更新
+      axiosObj.get(`oauth/refresh-token?refresh-token=${refreshToken}`).then(response => {
+        // 更新本地accessToken
+        userInfo.accessToken(response.accessToken)
+        userInfo.accessTokenExpiresIn(response.accessTokenExpiresIn)
+        userInfo.accessTokenUpdateAt(response.accessTokenUpdateAt)
+        userInfo.refreshToken(response.refreshToken)
+        userInfo.refreshTokenExpiresIn(response.refreshTokenExpiresIn)
+        userInfo.refreshTokenUpdateAt(response.refreshTokenUpdateAt)
+        // 成功
+        //console.log('accessToken更新成功,refreshToken更新为:'+userInfo.refreshToken());
+        //console.log('accessToken更新成功,refreshToken的更新时间为:'+tool.formatDate(userInfo.refreshTokenUpdateAt()));
+        //console.log('accessToken更新成功,refreshToken的有效时间为:'+userInfo.refreshTokenExpiresIn());
+        callback(userInfo.accessToken())
+        return true
+      }).catch(error => {
+        //userInfo.clear();
+        //console.log(error);
+        errorBack('E40001')
+        return false
+      })
+    } else {
+      //console.log('refreshToken已失效');
+      userInfo.clear()
+      // 失效
+      errorBack('E40003')
+      return false
+    }
+  }
+}
+
+const network = {
+  loginGetAccessToken(adminName, password, verifyCode, pageId) {
+    let promise = new Promise((resolve, reject) => {
+      // if(userInfo.hasLogin()){
+      //     reject('E40005');
+      //     return false;
+      // }
+      axiosObj.post(`oauth/login?page_id=${pageId}`, {
+        LoginForm: {
+          adminName,
+          password,
+          verifyCode,
+        }
+      }).then(response => {
+        // 更新本地accessToken
+        userInfo.updateLoginAllInfo(response)
+        // 成功
+        resolve(response)
+      }).catch(error => {
+        //console.log('登录获取数据错误');
+        userInfo.clear()
+        reject(error)
+      })
+    })
+    return promise
+  },
+  updateToken() {
+    let promise = new Promise((resolve, reject) => {
+      updateToken(function (accessToken) {
+        resolve(accessToken)
+      }, function (error) {
+        reject(error)
+      })
+    })
+    return promise
+  },
+  getUserInfo() {
+    let promise = new Promise((resolve, reject) => {
+      updateToken(function (accessToken) {
+        axiosObj.get(`oauth/info`, {
+          headers: {
+            'Authorization': ACCESS_TOKEN_PREFIX + accessToken,
+          }
+        }).then(response => {
+          // 更新本地userInfo
+          userInfo.userId(response.ID)
+          userInfo.adminName(response.ADMIN_NAME)
+          userInfo.baseData({roleId: response.ROLE_ID})
+          // 成功
+          resolve(response)
+        }).catch(error => {
+          reject(error)
+        })
+      }, function (error) {
+        reject(error)
+      })
+    })
+    return promise
+  },
+  getBaseInfo() {
+    let promise = new Promise((resolve, reject) => {
+      updateToken(function (accessToken) {
+        axiosObj.get(`site/base-info`, {
+          headers: {
+            'Authorization': ACCESS_TOKEN_PREFIX + accessToken,
+          }
+        }).then(response => {
+          // 更新本地baseInfo
+          baseInfo.set(response)
+          // 成功
+          resolve(response)
+        }).catch(error => {
+          reject(error)
+        })
+      }, function (error) {
+        reject(error)
+      })
+    })
+    return promise
+  },
+  getData(route, data = null) {
+    if (data === null) {
+      data = {}
+    }
+    let promise = new Promise((resolve, reject) => {
+      updateToken(function (accessToken) {
+        axiosObj.get(`${route}`, {
+          params: data,
+          headers: {
+            'Authorization': ACCESS_TOKEN_PREFIX + accessToken,
+          }
+        }).then(response => {
+          // 成功
+          resolve(response)
+        }).catch(error => {
+          error = tool.errorHandle(error)
+          ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
+          reject(error)
+        })
+      }, function (error) {
+        error = tool.errorHandle(error)
+        ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
+        reject(error)
+      })
+    })
+    return promise
+  },
+  postData(route, data) {
+    let promise = new Promise((resolve, reject) => {
+      updateToken(function (accessToken) {
+        axiosObj.post(`${route}`, data, {
+          headers: {
+            'Authorization': ACCESS_TOKEN_PREFIX + accessToken,
+          }
+        }).then(response => {
+          // 成功
+          resolve(response)
+        }).catch(error => {
+          error = tool.errorHandle(error)
+          ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
+          reject(error)
+        })
+      }, function (error) {
+        error = tool.errorHandle(error)
+        ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
+        reject(error)
+      })
+    })
+    return promise
+  },
+  getPageData(obj, path, page = null, pageSize = null, data = null, callback = null, isLoading = null, percentFieldName = null) {
+    if (isLoading === false) {
+      obj.loading = isLoading
+    } else {
+      obj.loading = true
+    }
+    if (page === null) page = 1
+    if (pageSize === null) pageSize = 20
+    let paramsData = {
+      page: page,
+      pageSize: pageSize,
+    }
+    if (data === null || tool.isEmptyObject(data)) {
+      // 查看地址栏中的内容,如果有内容则把地址栏中的参数给拿到
+      if(window.location.href.indexOf('filter') !== -1){
+        let nowUrl = tool.parseURL(window.location.href)
+        if(nowUrl.params.filter){
+          data = JSON.parse(unescape(nowUrl.params.filter))
+          if(obj.filterModel){
+            obj.filterModel = data
+          }
+        }
+      }
+    }
+    paramsData = Object.assign(paramsData, data)
+    network.getData(path, paramsData).then(response => {
+      obj.tableData = response.list
+      obj.tableHeaders = response.columnsShow ? response.columnsShow : []
+      obj.loading = false
+      obj.currentPage = page
+      obj.totalPages = parseInt(response.totalPages)
+      obj.totalCount = parseInt(response.totalCount)
+      obj.pageSize = pageSize
+      if (percentFieldName !== null) {
+        if(percentFieldName.length > 0){
+          for(let i in obj.tableData){
+            for(let j in percentFieldName){
+              obj.$set(obj.percentList[percentFieldName[j]], obj.tableData[i].ID, obj.tableData[i][percentFieldName[j]])
+            }
+          }
+        }
+      }
+      if (callback !== null) {
+        callback(response)
+      }
+    }).catch(response => {
+      obj.loading = false
+    })
+  },
+  getDaysDiff() {
+    let promise = new Promise((resolve, reject) => {
+      axiosObj.get(`site/days-diff`).then(response => {
+        // 更新本地baseInfo
+        baseInfo.setDaysDiff(response.daysDiff)
+        // 成功
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
+    return promise
+  }
+
+}
+
+export default network

+ 0 - 0
backendEle/src/views/bonus/prepare-period.vue


+ 1 - 1
backendEle/src/views/config/transfer.vue

@@ -96,7 +96,7 @@
         },
         loading: true,
         submitButtonStat: false,
-        allWallet:{'bonus':'会员账户','cash':'现金钱包'}
+        allWallet:{'bonus':'会员账户','cash':'现金钱包','point':'复消积分'}
       }
     },
     methods: {

+ 4 - 1
backendEle/src/views/finance/change-balance-opt.vue

@@ -90,6 +90,9 @@
     components: {LeoExcelUploader},
     mounted() {
       network.getData('finance/change-balance-type').then(response => {
+        console.log('response',response);
+        console.log('response.type:',response.type);
+        console.log('response.dealTypes:',response.dealTypes);
         this.type = response.type
         this.dealTypes = response.dealTypes
         this.loading = false
@@ -191,4 +194,4 @@
 
 <style scoped>
 
-</style>
+</style>

+ 181 - 181
backendEle/src/views/reconsume/pool-list.vue

@@ -1,181 +1,181 @@
-<template>
-  <div v-loading="loading">
-    <div class="white-box">
-      <div class="filter-box">
-        <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
-      </div>
-      <el-table :data="tableData" stripe style="width: 100%;" :height="tool.getTableHeight()">
-        <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header" :width="tableHeader.other.width ? tableHeader.other.width : ''">
-          <template slot-scope="scope">
-            <template v-if="scope.row[tableHeader.index].other.tag" >
-              <el-tag :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null" :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null" :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null" >{{scope.row[tableHeader.index].value}}</el-tag>
-            </template>
-            <template v-else-if="scope.row[tableHeader.index].other.progress" >
-              <el-progress type="circle" :percentage="Number.parseInt(percentList['MOVE_PERCENT'][scope.row.ID])"
-                           :width="50"
-                           :stroke-width="3"></el-progress>
-            </template>
-            <template v-else>
-              <div v-html="scope.row[tableHeader.index].value"></div>
-            </template>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" width="150" v-if="tableHeaders">
-          <template slot-scope="scope">
-            <el-button type="primary" size="small" @click.native="handleChangeUserName(scope.row.USER_NAME.value)" v-show="permission.hasPermission(`reconsume/change-audit-add`)">调整复销池余额</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <div class="white-box-footer">
-        <el-button type="primary" size="small" @click="handleChange" icon="el-icon-plus" v-show="permission.hasPermission(`reconsume/change-audit-add`)">申请调整复销池余额</el-button>
-        <el-button type="primary" size="small" @click="handleDeduct" icon="el-icon-plus" v-show="permission.hasPermission(`reconsume/deduct-audit-add`)">手动扣除月复销</el-button>
-        <el-button type="success" size="small" @click="handleExport"
-                   v-show="permission.hasPermission(`reconsume/pool-list-export`)">导出Excel
-        </el-button>
-        <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import network from '@/utils/network'
-import tool from '@/utils/tool'
-import FilterUser from '@/components/FilterUser'
-import baseInfo from '@/utils/baseInfo'
-import Pagination from '@/components/Pagination'
-import permission from '@/utils/permission'
-import filterHelper from '../../utils/filterHelper'
-
-export default {
-  name: 'reconsume_pool-list',
-  components: {FilterUser,Pagination},
-  mounted () {
-    this.getData()
-  },
-  data () {
-    return {
-      tableHeaders: null,
-      allData: null,
-      tableData: null,
-      loading: true,
-      multipleSelection: [],
-      currentPage: 1,
-      totalPages: 1,
-      totalCount: 1,
-      pageSize: 20,
-      tool: tool,
-      permission: permission,
-      filterTypes: {
-        'USER_NAME': {isUserTable: true, name: '会员编号'},
-        'REAL_NAME': {isUserTable: true, name: '会员姓名'},
-        'STATUS': {isUserTable: true, name: '会员状态', other: 'status'},
-        'DEC_LV': {isUserTable: true, name: '实时会员级别', other: 'decLevel'},
-        'LAST_DEC_LV': {isUserTable: true, name: '结算时会员级别', other: 'decLevel'},
-        'EMP_LV': {isUserTable: true, name: '实时聘级', other: 'empLevel'},
-        'UNUSED_PV': {isUserTable: false, name: '复销池余额'},
-        'UNUSED_MONTH': {isUserTable: false, name: '赠送优惠期剩余月数'},
-        'CREATED_AT': {isUserTable: true, name: '加入时间', other: 'date'},
-        'PERIOD_AT': {isUserTable: true, name: '加入期数'},
-      },
-      filterModel: {},
-      baseInfo: baseInfo,
-    }
-  },
-  methods: {
-    handleSelectionChange (val) {
-      this.multipleSelection = val
-    },
-    handleCurrentChange (page) {
-      this.getData(page, this.pageSize)
-    },
-    handleSizeChange (pageSize) {
-      this.getData(this.currentPage, pageSize)
-    },
-    handlePass(row){
-      this.$confirm('确定要为该会员扣除复销并设为合格吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        return network.postData(`reconsume/deduct`, {
-          userName: row.USER_NAME.value,
-          isPass: true,
-        })
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-      }).catch(response => {
-
-      })
-    },
-    handleNotPass(row){
-      this.$confirm('确定要为该会员扣除复销并设为不合格吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        return network.postData(`reconsume/deduct`, {
-          userName: row.USER_NAME.value,
-          isPass: false,
-        })
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-        this.getData(this.currentPage, this.pageSize)
-      }).catch(response => {
-
-      })
-    },
-    handleDeduct() {
-      this.$router.push(`/reconsume/deduct-audit-add`)
-    },
-    handleChangeUserName(userName) {
-      this.$router.push({path:`/reconsume/change-audit-add/${userName}`})
-    },
-    handleChange() {
-      this.$router.push({path:`/reconsume/change-audit-add`})
-    },
-    handleFilterUser(filterData) {
-      filterHelper.handleFilterUser(this, filterData)
-    },
-    handleFilter() {
-      this.getData()
-    },
-    getData(page, pageSize) {
-      let filterData = this.filterModel
-      let vueObj=this
-      network.getPageData(this, 'reconsume/pool-list', page, pageSize, filterData, function (response) {
-        vueObj.allData = response
-        vueObj.filterTypes = response.filterTypes
-      })
-    },
-    handleExport(){
-      this.$confirm(`确定要导出当前数据吗?`, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        return network.getData(`reconsume/pool-list-export`, this.filterModel)
-      }).then(response => {
-        this.$message({
-          message: response,
-          type: 'success'
-        })
-      }).catch(response => {
-
-      })
-    },
-  }
-}
-
-</script>
-
-<style scoped>
-
-</style>
+<template>
+  <div v-loading="loading">
+    <div class="white-box">
+      <div class="filter-box">
+        <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
+      </div>
+      <el-table :data="tableData" stripe style="width: 100%;" :height="tool.getTableHeight()">
+        <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header" :width="tableHeader.other.width ? tableHeader.other.width : ''">
+          <template slot-scope="scope">
+            <template v-if="scope.row[tableHeader.index].other.tag" >
+              <el-tag :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null" :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null" :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null" >{{scope.row[tableHeader.index].value}}</el-tag>
+            </template>
+            <template v-else-if="scope.row[tableHeader.index].other.progress" >
+              <el-progress type="circle" :percentage="Number.parseInt(percentList['MOVE_PERCENT'][scope.row.ID])"
+                           :width="50"
+                           :stroke-width="3"></el-progress>
+            </template>
+            <template v-else>
+              <div v-html="scope.row[tableHeader.index].value"></div>
+            </template>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="150" v-if="tableHeaders">
+          <template slot-scope="scope">
+            <el-button type="primary" size="small" @click.native="handleChangeUserName(scope.row.USER_NAME.value)" v-show="permission.hasPermission(`reconsume/change-audit-add`)">调整复销池余额</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="white-box-footer">
+        <el-button type="primary" size="small" @click="handleChange" icon="el-icon-plus" v-show="permission.hasPermission(`reconsume/change-audit-add`)">申请调整复销池余额</el-button>
+        <el-button type="primary" size="small" @click="handleDeduct" icon="el-icon-plus" v-show="permission.hasPermission(`reconsume/deduct-audit-add`)">手动扣除月复销</el-button>
+        <el-button type="success" size="small" @click="handleExport"
+                   v-show="permission.hasPermission(`reconsume/pool-list-export`)">导出Excel
+        </el-button>
+        <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import network from '@/utils/network'
+import tool from '@/utils/tool'
+import FilterUser from '@/components/FilterUser'
+import baseInfo from '@/utils/baseInfo'
+import Pagination from '@/components/Pagination'
+import permission from '@/utils/permission'
+import filterHelper from '../../utils/filterHelper'
+
+export default {
+  name: 'reconsume_pool-list',
+  components: {FilterUser,Pagination},
+  mounted () {
+    this.getData()
+  },
+  data () {
+    return {
+      tableHeaders: null,
+      allData: null,
+      tableData: null,
+      loading: true,
+      multipleSelection: [],
+      currentPage: 1,
+      totalPages: 1,
+      totalCount: 1,
+      pageSize: 20,
+      tool: tool,
+      permission: permission,
+      filterTypes: {
+        'USER_NAME': {isUserTable: true, name: '会员编号'},
+        'REAL_NAME': {isUserTable: true, name: '会员姓名'},
+        'STATUS': {isUserTable: true, name: '会员状态', other: 'status'},
+        'DEC_LV': {isUserTable: true, name: '实时会员级别', other: 'decLevel'},
+        'LAST_DEC_LV': {isUserTable: true, name: '结算时会员级别', other: 'decLevel'},
+        'EMP_LV': {isUserTable: true, name: '实时聘级', other: 'empLevel'},
+        'UNUSED_PV': {isUserTable: false, name: '复销池余额'},
+        'UNUSED_MONTH': {isUserTable: false, name: '赠送优惠期剩余月数'},
+        'CREATED_AT': {isUserTable: true, name: '加入时间', other: 'date'},
+        'PERIOD_AT': {isUserTable: true, name: '加入期数'},
+      },
+      filterModel: {},
+      baseInfo: baseInfo,
+    }
+  },
+  methods: {
+    handleSelectionChange (val) {
+      this.multipleSelection = val
+    },
+    handleCurrentChange (page) {
+      this.getData(page, this.pageSize)
+    },
+    handleSizeChange (pageSize) {
+      this.getData(this.currentPage, pageSize)
+    },
+    handlePass(row){
+      this.$confirm('确定要为该会员扣除复销并设为合格吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return network.postData(`reconsume/deduct`, {
+          userName: row.USER_NAME.value,
+          isPass: true,
+        })
+      }).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        this.getData(this.currentPage, this.pageSize)
+      }).catch(response => {
+
+      })
+    },
+    handleNotPass(row){
+      this.$confirm('确定要为该会员扣除复销并设为不合格吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return network.postData(`reconsume/deduct`, {
+          userName: row.USER_NAME.value,
+          isPass: false,
+        })
+      }).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        this.getData(this.currentPage, this.pageSize)
+      }).catch(response => {
+
+      })
+    },
+    handleDeduct() {
+      this.$router.push(`/reconsume/deduct-audit-add`)
+    },
+    handleChangeUserName(userName) {
+      this.$router.push({path:`/reconsume/change-audit-add/${userName}`})
+    },
+    handleChange() {
+      this.$router.push({path:`/reconsume/change-audit-add`})
+    },
+    handleFilterUser(filterData) {
+      filterHelper.handleFilterUser(this, filterData)
+    },
+    handleFilter() {
+      this.getData()
+    },
+    getData(page, pageSize) {
+      let filterData = this.filterModel
+      let vueObj=this
+      network.getPageData(this, 'reconsume/pool-list', page, pageSize, filterData, function (response) {
+        vueObj.allData = response
+        vueObj.filterTypes = response.filterTypes
+      })
+    },
+    handleExport(){
+      this.$confirm(`确定要导出当前数据吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return network.getData(`reconsume/pool-list-export`, this.filterModel)
+      }).then(response => {
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+      }).catch(response => {
+
+      })
+    },
+  }
+}
+
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 0
backendEle/src/views/shop/dec-order-list.vue

@@ -100,6 +100,7 @@
         }).then(() => {
           return network.getData(`shop/dec-order-list-export`, this.filterModel)
         }).then(response => {
+
           this.$message({
             message: response,
             type: 'success'

+ 846 - 845
backendEle/src/views/user/index.vue

@@ -1,847 +1,848 @@
-<template>
-  <div v-loading="loading">
-    <div class="white-box">
-      <div class="filter-box">
-        <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
-      </div>
-      <el-table ref="wrapper" :data="tableData" stripe style="width: 100%;" @selection-change="handleSelectionChange"
-                :height="tool.getTableHeight()">
-        <el-table-column fixed type="selection" width="55" v-if="tableHeaders"></el-table-column>
-        <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header"
-                         :width="tableHeader.other.width ? tableHeader.other.width : ''" :fixed="tableHeader.index=='USER_NAME' || tableHeader.index=='REAL_NAME' ?true:false">
-          <template slot-scope="scope">
-            <template v-if="scope.row[tableHeader.index].other.tag">
-              <el-tag
-                  :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null"
-                  :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null"
-                  :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null">
-                {{scope.row[tableHeader.index].value}}
-              </el-tag>
-            </template>
-            <template v-else>
-              <template v-if="tableHeader.index === 'USER_NAME'">
-                <el-dropdown v-if="permission.hasPermission(`user/login-to-frontend`)">
-  <span class="el-dropdown-link">
-    {{scope.row.USER_NAME.value}} <i class="el-icon-arrow-down el-icon--right"></i>
-  </span>
-                  <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item command="login" v-show="scope.row.BTF_URL !== null">
-                      <a :href="`${frontendServer}/#/login-by-backend?${scope.row.BTF_URL}`" target="_blank"
-                         style="color:#606266;">快速登录</a>
-                    </el-dropdown-item>
-                  </el-dropdown-menu>
-                </el-dropdown>
-                <el-tag type="primary" size="small" class="no-border"
-                        v-if="!permission.hasPermission(`user/login-to-frontend`)">{{scope.row.USER_NAME.value}}
-                </el-tag>
-              </template>
-              <template v-else>
-                <div v-html="scope.row[tableHeader.index].value"></div>
-              </template>
-            </template>
-          </template>
-        </el-table-column>
-        <el-table-column fixed="right" label="操作" width="180">
-          <template slot-scope="scope">
-            <el-dropdown size="small" trigger="click">
-              <el-button type="primary" size="small" @click.stop="">
-                操作该数据<i class="el-icon-arrow-down el-icon--right"></i>
-              </el-button>
-              <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item @click.native="handleModifyPassword(scope.row)"
-                                  v-if="permission.hasPermission(`user/modify-password`)">修改密码
-                </el-dropdown-item>
-                <el-dropdown-item @click.native="handleModifyProfile(scope.row)"
-                                  v-if="permission.hasPermission(`user/modify-profile`)">修改个人资料
-                </el-dropdown-item>
-                <el-dropdown-item @click.native="handleStatusActive(scope.row)" v-if="permission.hasPermission(`user/modify-status`)">状态激活 </el-dropdown-item>
-                <el-dropdown-item @click.native="handleStatusLock(scope.row)" v-if="permission.hasPermission(`user/modify-status`)">状态锁定 </el-dropdown-item>
-                <el-dropdown-item @click.native="handleIsModifyPassword(scope.row, 1)" v-if="permission.hasPermission(`user/is-modify-password-status`)">开启密码修改</el-dropdown-item>
-                <el-dropdown-item @click.native="handleIsModifyPassword(scope.row, 0)" v-if="permission.hasPermission(`user/is-modify-password-status`)">关闭密码修改</el-dropdown-item>
-              </el-dropdown-menu>
-            </el-dropdown>
-          </template>
-        </el-table-column>
-      </el-table>
-      <div class="white-box-footer">
-        <!--<el-dropdown size="small" trigger="click"-->
-                     <!--v-show="permission.hasPermission(`user/close-login`)||permission.hasPermission(`user/close-area-login`)||permission.hasPermission(`user/batch-close-login`)">-->
-          <!--<el-button type="primary" size="small" @click.stop="">-->
-            <!--登录管理<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
-          <!--</el-button>-->
-          <!--<el-dropdown-menu slot="dropdown">-->
-            <!--<el-dropdown-item command="closeLogin" @click.native="handleLoginManage(1)"-->
-                              <!--v-show="permission.hasPermission(`user/batch-close-login`)">按指定会员管理登录-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeLogin" @click.native="handleLoginManage(2)"-->
-                              <!--v-show="permission.hasPermission(`user/close-login`)">按开拓网络管理登录-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeLogin" @click.native="handleLoginManage(3)"-->
-                              <!--v-show="permission.hasPermission(`user/close-login`)">按安置网络管理登录-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeLogin" @click.native="handleLoginManage(4)"-->
-                              <!--v-show="permission.hasPermission(`user/close-login`)">按会员体系管理登录-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeLogin" @click.native="handleLoginManage(5)"-->
-                              <!--v-show="permission.hasPermission(`user/close-area-login`)">按省份地区管理登录-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeLogin" @click.native="handleCloseLogin(1, 1)" v-show="false">禁止商城系统登录-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="allowLogin" @click.native="handleCloseLogin(0, 1)" v-show="false">允许商城系统登录-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeLogin" @click.native="handleCloseLogin(1, 2)" v-show="false">禁止结算系统登录-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="allowLogin" @click.native="handleCloseLogin(0, 2)" v-show="false">允许结算系统登录-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeLogin" @click.native="handleCloseLogin(1, 3)" v-show="false">全部禁止登录-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="allowLogin" @click.native="handleCloseLogin(0, 3)" v-show="false">全部允许登录-->
-            <!--</el-dropdown-item>-->
-          <!--</el-dropdown-menu>-->
-        <!--</el-dropdown>-->
-        <!--<el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-group`)">-->
-          <!--<el-button type="primary" size="small" @click.stop="">-->
-            <!--团队管理<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
-          <!--</el-button>-->
-          <!--<el-dropdown-menu slot="dropdown">-->
-            <!--<el-dropdown-item command="isGroup" @click.native="handleGroupManage(true)">设为团队领导人</el-dropdown-item>-->
-            <!--<el-dropdown-item command="notGroup" @click.native="handleGroupManage(false)">取消团队领导人-->
-            <!--</el-dropdown-item>-->
-          <!--</el-dropdown-menu>-->
-        <!--</el-dropdown>-->
-        <el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-dec`)">
-          <el-button type="primary" size="small" @click.stop="">
-            报单中心管理<i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="isDec" @click.native="handleIsDecManage(true)">设为报单中心</el-dropdown-item>
-            <el-dropdown-item command="notDec" @click.native="handleIsDecManage(false)">取消报单中心
-            </el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-
-        <el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-studio`)">
-          <el-button type="primary" size="small" @click.stop="">
-            工作室管理<i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="isStudio" @click.native="handleIsStudioManage(true)">设为工作室</el-dropdown-item>
-            <el-dropdown-item command="notStudio" @click.native="handleIsStudioManage(false)">取消工作室
-            </el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-
-        <el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-atlas`)">
-          <el-button type="primary" size="small" @click.stop="">
-            图谱管理<i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="isAtlas" @click.native="handleIsAtlasManage(true)">显示图谱</el-dropdown-item>
-            <el-dropdown-item command="notAtlas" @click.native="handleIsAtlasManage(false)">隐藏图谱
-            </el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-
-        <el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-recharge`)">
-          <el-button type="primary" size="small" @click.stop="">
-            充值管理<i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="isAtlas" @click.native="handleIsRechargeManage(true)">显示充值</el-dropdown-item>
-            <el-dropdown-item command="notAtlas" @click.native="handleIsRechargeManage(false)">隐藏充值
-            </el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-        <!--<el-dropdown size="small" trigger="click"-->
-                     <!--v-show="permission.hasPermission(`user/close-dec`)||permission.hasPermission(`user/close-area-dec`)||permission.hasPermission(`user/batch-close-dec`)">-->
-          <!--<el-button type="primary" size="small" @click.stop="">-->
-            <!--报单管理<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
-          <!--</el-button>-->
-          <!--<el-dropdown-menu slot="dropdown">-->
-            <!--<el-dropdown-item command="closeDec" @click.native="handleDecManage(1)"-->
-                              <!--v-show="permission.hasPermission(`user/batch-close-dec`)">按指定会员管理报单-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeDec" @click.native="handleDecManage(2)"-->
-                              <!--v-show="permission.hasPermission(`user/close-dec`)">按开拓网络管理报单-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeDec" @click.native="handleDecManage(3)"-->
-                              <!--v-show="permission.hasPermission(`user/close-dec`)">按安置网络管理报单-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeDec" @click.native="handleDecManage(4)"-->
-                              <!--v-show="permission.hasPermission(`user/close-dec`)">按会员体系管理报单-->
-            <!--</el-dropdown-item>-->
-            <!--<el-dropdown-item command="closeDec" @click.native="handleDecManage(5)"-->
-                              <!--v-show="permission.hasPermission(`user/close-area-dec`)">按省份地区管理报单-->
-            <!--</el-dropdown-item>-->
-          <!--</el-dropdown-menu>-->
-        <!--</el-dropdown>-->
-        <el-button type="success" size="small" @click="handleExport"
-                   v-show="permission.hasPermission(`user/index-export`)">导出Excel
-        </el-button>
-        <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange"
-                    @current-change="handleCurrentChange"></pagination>
-      </div>
-    </div>
-    <el-dialog :title="formModifyPassword.typeName" :visible.sync="dialogModifyPasswordVisible" width="50%">
-      <el-form ref="form" :model="formModifyPassword" label-width="120px" class="form-dialog">
-        <el-form-item label="类型">
-          <el-select v-model="formModifyPassword.passwordType" placeholder="请选择类型">
-            <el-option v-for="(item,key) in passwordType" :label="item.label" :value="item.type"
-                       :key="key"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="密码">
-          <el-input placeholder="密码" v-model="formModifyPassword.password">
-          </el-input>
-        </el-form-item>
-        <!--<el-form-item label="备注">-->
-          <!--<el-input type="text" :rows="2" placeholder="备注" v-model="formModifyPassword.remark">-->
-          <!--</el-input>-->
-        <!--</el-form-item>-->
-        <el-form-item>
-          <el-button type="primary" @click="handleModifyPasswordSubmit" :loading="submitPasswordButtonStat">提交</el-button>
-        </el-form-item>
-      </el-form>
-    </el-dialog>
-
-    <el-dialog :title="formModifyProfile.typeName" :visible.sync="dialogModifyProfileVisible" width="50%">
-      <el-form ref="form" :model="formModifyProfile" label-width="120px" class="form-dialog">
-        <el-form-item label="民族">
-          <el-select v-model="formModifyProfile.nation" placeholder="请选择民族">
-            <el-option v-for="(item,index) in allNation" :key="index" :label="item.name"
-                       :value="item.id"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="会员姓名">
-          <el-input v-model="formModifyProfile.realName"></el-input>
-        </el-form-item>
-        <el-form-item label="身份证号">
-          <el-input v-model="formModifyProfile.idCard"></el-input>
-        </el-form-item>
-        <el-form-item label="手机号">
-          <el-input v-model="formModifyProfile.mobile"></el-input>
-        </el-form-item>
-        <el-form-item label="银行名称">
-          <el-select v-model="formModifyProfile.openBank" placeholder="请选择银行名称">
-            <el-option v-for="(item,index) in allOpenBank" :key="index" :label="item.BANK_NAME"
-                       :value="item.BANK_CODE"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="开户行地址">
-          <el-input v-model="formModifyProfile.bankAddress"></el-input>
-        </el-form-item>
-        <el-form-item label="银行帐号">
-          <el-input v-model="formModifyProfile.bankNo"></el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="handleModifyProfileSubmit" :loading="submitProfileButtonStat">提交</el-button>
-        </el-form-item>
-      </el-form>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-  import network from './../../utils/network'
-  import tool from './../../utils/tool'
-  import {FRONTEND_SERVER} from '@/utils/config'
-  import baseInfo from '@/utils/baseInfo'
-  import FilterUser from '../../components/FilterUser'
-  import store from './../../utils/vuexStore'
-  import permission from '@/utils/permission'
-  import Pagination from '@/components/Pagination'
-  import filterHelper from '../../utils/filterHelper'
-
-  export default {
-    name: 'user_index',
-    components: {FilterUser, Pagination},
-    mounted() {
-      let _this = this
-      if (permission.hasPermission(`user/close-login`) || permission.hasPermission(`user/close-area-login`) || permission.hasPermission(`user/batch-close-login`)) {
-        network.getData('user/close-login-get').then(response => {
-          _this.apps = response.apps
-          _this.closeSwitch = response.closeSwitch
-          if (permission.hasPermission(`user/close-dec`) || permission.hasPermission(`user/close-area-dec`) || permission.hasPermission(`user/batch-close-dec`)) {
-            network.getData('user/close-dec-get').then(response => {
-              _this.closeDecSwitch = response.closeSwitch
-              _this.getData()
-            }).catch(error => {
-            })
-          } else {
-            _this.getData()
-          }
-        }).catch(error => {
-        })
-      } else {
-        if (permission.hasPermission(`user/close-dec`) || permission.hasPermission(`user/close-area-dec`) || permission.hasPermission(`user/batch-close-dec`)) {
-          network.getData('user/close-dec-get').then(response => {
-            _this.closeDecSwitch = response.closeSwitch
-            _this.getData()
-          }).catch(error => {
-          })
-        } else {
-          _this.getData()
-        }
-      }
-      store.state.socket.onMessageCallback = this.onMessageCallback
-    },
-    data() {
-      return {
-        tableHeaders: null,
-        tableData: null,
-        loading: true,
-        multipleSelection: [],
-        currentPage: 1,
-        totalPages: 1,
-        totalCount: 1,
-        pageSize: 20,
-        frontendServer: FRONTEND_SERVER,
-        baseDecLevels: baseInfo.decLevels(),
-        baseEmpLevels: baseInfo.empLevels(),
-        tool: tool,
-        permission: permission,
-        filterTypes: null,
-        filterModel: {},
-        dialogVisible: false,
-        formCloseLogin: {
-          userName: null,
-          typeName: '登录管理',
-          type: null,
-          isClose: 0,
-          remark: '',
-          areaSelected: null,
-        },
-        regionDataPlus: store.state.regionInfo.regionData,
-        apps: null,
-        closeSwitch: null,
-        submitButtonStat: false,
-        dialogDecVisible: false,
-        dialogModifyPasswordVisible: false,
-        dialogModifyProfileVisible: false,
-        formCloseDec: {
-          userName: null,
-          typeName: '管理报单',
-          type: null,
-          isClose: 0,
-          remark: '',
-          areaSelected: null,
-        },
-        formModifyPassword: {
-            userId:'',
-            password: '',
-            typeName: '修改密码',
-            passwordType: 'password',
-            // remark: '',
-        },
-        formModifyProfile: {
-            userId:'',
-            typeName: '修改个人资料',
-            nation: '',
-            realName: '',
-            idCard: '',
-            mobile: '',
-            openBank: '',
-            bankAddress: '',
-            bankNo: '',
-        },
-        passwordType: [
-            {
-                type:"password",
-                label:"登录密码"
-            },
-            {
-                type:"payPassword",
-                label:"支付密码"
-            },
-        ],
-        allOpenBank:null,
-        allNation:null,
-        submitDecButtonStat: false,
-        submitPasswordButtonStat: false,
-        submitProfileButtonStat: false,
-        transferPropForm: {
-          userIds: [],
-          allowTransfer: true,
-          transferProp: 100,
-          withdrawProp: 0,
-          remark: '',
-        },
-        closeUserData: null,
-      }
-    },
-    methods: {
+<template>
+  <div v-loading="loading">
+    <div class="white-box">
+      <div class="filter-box">
+        <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
+      </div>
+      <el-table ref="wrapper" :data="tableData" stripe style="width: 100%;" @selection-change="handleSelectionChange"
+                :height="tool.getTableHeight()">
+        <el-table-column fixed type="selection" width="55" v-if="tableHeaders"></el-table-column>
+        <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header"
+                         :width="tableHeader.other.width ? tableHeader.other.width : ''" :fixed="tableHeader.index=='USER_NAME' || tableHeader.index=='REAL_NAME' ?true:false">
+          <template slot-scope="scope">
+            <template v-if="scope.row[tableHeader.index].other.tag">
+              <el-tag
+                  :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null"
+                  :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null"
+                  :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null">
+                {{scope.row[tableHeader.index].value}}
+              </el-tag>
+            </template>
+            <template v-else>
+              <template v-if="tableHeader.index === 'USER_NAME'">
+                <el-dropdown v-if="permission.hasPermission(`user/login-to-frontend`)">
+  <span class="el-dropdown-link">
+    {{scope.row.USER_NAME.value}} <i class="el-icon-arrow-down el-icon--right"></i>
+  </span>
+                  <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-item command="login" v-show="scope.row.BTF_URL !== null">
+                      <a :href="`${frontendServer}/#/login-by-backend?${scope.row.BTF_URL}`" target="_blank"
+                         style="color:#606266;">快速登录</a>
+                    </el-dropdown-item>
+                  </el-dropdown-menu>
+                </el-dropdown>
+                <el-tag type="primary" size="small" class="no-border"
+                        v-if="!permission.hasPermission(`user/login-to-frontend`)">{{scope.row.USER_NAME.value}}
+                </el-tag>
+              </template>
+              <template v-else>
+                <div v-html="scope.row[tableHeader.index].value"></div>
+              </template>
+            </template>
+          </template>
+        </el-table-column>
+        <el-table-column fixed="right" label="操作" width="180">
+          <template slot-scope="scope">
+            <el-dropdown size="small" trigger="click">
+              <el-button type="primary" size="small" @click.stop="">
+                操作该数据<i class="el-icon-arrow-down el-icon--right"></i>
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item @click.native="handleModifyPassword(scope.row)"
+                                  v-if="permission.hasPermission(`user/modify-password`)">修改密码
+                </el-dropdown-item>
+                <el-dropdown-item @click.native="handleModifyProfile(scope.row)"
+                                  v-if="permission.hasPermission(`user/modify-profile`)">修改个人资料
+                </el-dropdown-item>
+                <el-dropdown-item @click.native="handleStatusActive(scope.row)" v-if="permission.hasPermission(`user/modify-status`)">状态激活 </el-dropdown-item>
+                <el-dropdown-item @click.native="handleStatusLock(scope.row)" v-if="permission.hasPermission(`user/modify-status`)">状态锁定 </el-dropdown-item>
+                <el-dropdown-item @click.native="handleIsModifyPassword(scope.row, 1)" v-if="permission.hasPermission(`user/is-modify-password-status`)">开启密码修改</el-dropdown-item>
+                <el-dropdown-item @click.native="handleIsModifyPassword(scope.row, 0)" v-if="permission.hasPermission(`user/is-modify-password-status`)">关闭密码修改</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="white-box-footer">
+        <!--<el-dropdown size="small" trigger="click"-->
+                     <!--v-show="permission.hasPermission(`user/close-login`)||permission.hasPermission(`user/close-area-login`)||permission.hasPermission(`user/batch-close-login`)">-->
+          <!--<el-button type="primary" size="small" @click.stop="">-->
+            <!--登录管理<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
+          <!--</el-button>-->
+          <!--<el-dropdown-menu slot="dropdown">-->
+            <!--<el-dropdown-item command="closeLogin" @click.native="handleLoginManage(1)"-->
+                              <!--v-show="permission.hasPermission(`user/batch-close-login`)">按指定会员管理登录-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeLogin" @click.native="handleLoginManage(2)"-->
+                              <!--v-show="permission.hasPermission(`user/close-login`)">按开拓网络管理登录-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeLogin" @click.native="handleLoginManage(3)"-->
+                              <!--v-show="permission.hasPermission(`user/close-login`)">按安置网络管理登录-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeLogin" @click.native="handleLoginManage(4)"-->
+                              <!--v-show="permission.hasPermission(`user/close-login`)">按会员体系管理登录-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeLogin" @click.native="handleLoginManage(5)"-->
+                              <!--v-show="permission.hasPermission(`user/close-area-login`)">按省份地区管理登录-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeLogin" @click.native="handleCloseLogin(1, 1)" v-show="false">禁止商城系统登录-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="allowLogin" @click.native="handleCloseLogin(0, 1)" v-show="false">允许商城系统登录-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeLogin" @click.native="handleCloseLogin(1, 2)" v-show="false">禁止结算系统登录-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="allowLogin" @click.native="handleCloseLogin(0, 2)" v-show="false">允许结算系统登录-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeLogin" @click.native="handleCloseLogin(1, 3)" v-show="false">全部禁止登录-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="allowLogin" @click.native="handleCloseLogin(0, 3)" v-show="false">全部允许登录-->
+            <!--</el-dropdown-item>-->
+          <!--</el-dropdown-menu>-->
+        <!--</el-dropdown>-->
+        <!--<el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-group`)">-->
+          <!--<el-button type="primary" size="small" @click.stop="">-->
+            <!--团队管理<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
+          <!--</el-button>-->
+          <!--<el-dropdown-menu slot="dropdown">-->
+            <!--<el-dropdown-item command="isGroup" @click.native="handleGroupManage(true)">设为团队领导人</el-dropdown-item>-->
+            <!--<el-dropdown-item command="notGroup" @click.native="handleGroupManage(false)">取消团队领导人-->
+            <!--</el-dropdown-item>-->
+          <!--</el-dropdown-menu>-->
+        <!--</el-dropdown>-->
+        <el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-dec`)">
+          <el-button type="primary" size="small" @click.stop="">
+            报单中心管理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="isDec" @click.native="handleIsDecManage(true)">设为报单中心</el-dropdown-item>
+            <el-dropdown-item command="notDec" @click.native="handleIsDecManage(false)">取消报单中心
+            </el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+
+        <el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-studio`)">
+          <el-button type="primary" size="small" @click.stop="">
+            工作室管理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="isStudio" @click.native="handleIsStudioManage(true)">设为工作室</el-dropdown-item>
+            <el-dropdown-item command="notStudio" @click.native="handleIsStudioManage(false)">取消工作室
+            </el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+
+        <el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-atlas`)">
+          <el-button type="primary" size="small" @click.stop="">
+            图谱管理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="isAtlas" @click.native="handleIsAtlasManage(true)">显示图谱</el-dropdown-item>
+            <el-dropdown-item command="notAtlas" @click.native="handleIsAtlasManage(false)">隐藏图谱
+            </el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+
+        <el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-recharge`)">
+          <el-button type="primary" size="small" @click.stop="">
+            充值管理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="isAtlas" @click.native="handleIsRechargeManage(true)">显示充值</el-dropdown-item>
+            <el-dropdown-item command="notAtlas" @click.native="handleIsRechargeManage(false)">隐藏充值
+            </el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+        <!--<el-dropdown size="small" trigger="click"-->
+                     <!--v-show="permission.hasPermission(`user/close-dec`)||permission.hasPermission(`user/close-area-dec`)||permission.hasPermission(`user/batch-close-dec`)">-->
+          <!--<el-button type="primary" size="small" @click.stop="">-->
+            <!--报单管理<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
+          <!--</el-button>-->
+          <!--<el-dropdown-menu slot="dropdown">-->
+            <!--<el-dropdown-item command="closeDec" @click.native="handleDecManage(1)"-->
+                              <!--v-show="permission.hasPermission(`user/batch-close-dec`)">按指定会员管理报单-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeDec" @click.native="handleDecManage(2)"-->
+                              <!--v-show="permission.hasPermission(`user/close-dec`)">按开拓网络管理报单-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeDec" @click.native="handleDecManage(3)"-->
+                              <!--v-show="permission.hasPermission(`user/close-dec`)">按安置网络管理报单-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeDec" @click.native="handleDecManage(4)"-->
+                              <!--v-show="permission.hasPermission(`user/close-dec`)">按会员体系管理报单-->
+            <!--</el-dropdown-item>-->
+            <!--<el-dropdown-item command="closeDec" @click.native="handleDecManage(5)"-->
+                              <!--v-show="permission.hasPermission(`user/close-area-dec`)">按省份地区管理报单-->
+            <!--</el-dropdown-item>-->
+          <!--</el-dropdown-menu>-->
+        <!--</el-dropdown>-->
+        <el-button type="success" size="small" @click="handleExport"
+                   v-show="permission.hasPermission(`user/index-export`)">导出Excel
+        </el-button>
+        <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange"
+                    @current-change="handleCurrentChange"></pagination>
+      </div>
+    </div>
+    <el-dialog :title="formModifyPassword.typeName" :visible.sync="dialogModifyPasswordVisible" width="50%">
+      <el-form ref="form" :model="formModifyPassword" label-width="120px" class="form-dialog">
+        <el-form-item label="类型">
+          <el-select v-model="formModifyPassword.passwordType" placeholder="请选择类型">
+            <el-option v-for="(item,key) in passwordType" :label="item.label" :value="item.type"
+                       :key="key"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="密码">
+          <el-input placeholder="密码" v-model="formModifyPassword.password">
+          </el-input>
+        </el-form-item>
+        <!--<el-form-item label="备注">-->
+          <!--<el-input type="text" :rows="2" placeholder="备注" v-model="formModifyPassword.remark">-->
+          <!--</el-input>-->
+        <!--</el-form-item>-->
+        <el-form-item>
+          <el-button type="primary" @click="handleModifyPasswordSubmit" :loading="submitPasswordButtonStat">提交</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+
+    <el-dialog :title="formModifyProfile.typeName" :visible.sync="dialogModifyProfileVisible" width="50%">
+      <el-form ref="form" :model="formModifyProfile" label-width="120px" class="form-dialog">
+        <el-form-item label="民族">
+          <el-select v-model="formModifyProfile.nation" placeholder="请选择民族">
+            <el-option v-for="(item,index) in allNation" :key="index" :label="item.name"
+                       :value="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="会员姓名">
+          <el-input v-model="formModifyProfile.realName"></el-input>
+        </el-form-item>
+        <el-form-item label="身份证号">
+          <el-input v-model="formModifyProfile.idCard"></el-input>
+        </el-form-item>
+        <el-form-item label="手机号">
+          <el-input v-model="formModifyProfile.mobile"></el-input>
+        </el-form-item>
+        <el-form-item label="银行名称">
+          <el-select v-model="formModifyProfile.openBank" placeholder="请选择银行名称">
+            <el-option v-for="(item,index) in allOpenBank" :key="index" :label="item.BANK_NAME"
+                       :value="item.BANK_CODE"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="开户行地址">
+          <el-input v-model="formModifyProfile.bankAddress"></el-input>
+        </el-form-item>
+        <el-form-item label="银行帐号">
+          <el-input v-model="formModifyProfile.bankNo"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="handleModifyProfileSubmit" :loading="submitProfileButtonStat">提交</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import network from './../../utils/network'
+  import tool from './../../utils/tool'
+  import {FRONTEND_SERVER} from '@/utils/config'
+  import baseInfo from '@/utils/baseInfo'
+  import FilterUser from '../../components/FilterUser'
+  import store from './../../utils/vuexStore'
+  import permission from '@/utils/permission'
+  import Pagination from '@/components/Pagination'
+  import filterHelper from '../../utils/filterHelper'
+
+  export default {
+    name: 'user_index',
+    components: {FilterUser, Pagination},
+    mounted() {
+      let _this = this
+      if (permission.hasPermission(`user/close-login`) || permission.hasPermission(`user/close-area-login`) || permission.hasPermission(`user/batch-close-login`)) {
+        network.getData('user/close-login-get').then(response => {
+          _this.apps = response.apps
+          _this.closeSwitch = response.closeSwitch
+          if (permission.hasPermission(`user/close-dec`) || permission.hasPermission(`user/close-area-dec`) || permission.hasPermission(`user/batch-close-dec`)) {
+            network.getData('user/close-dec-get').then(response => {
+              _this.closeDecSwitch = response.closeSwitch
+              _this.getData()
+            }).catch(error => {
+            })
+          } else {
+            _this.getData()
+          }
+        }).catch(error => {
+        })
+      } else {
+        if (permission.hasPermission(`user/close-dec`) || permission.hasPermission(`user/close-area-dec`) || permission.hasPermission(`user/batch-close-dec`)) {
+          network.getData('user/close-dec-get').then(response => {
+            _this.closeDecSwitch = response.closeSwitch
+            _this.getData()
+          }).catch(error => {
+          })
+        } else {
+          _this.getData()
+        }
+      }
+      store.state.socket.onMessageCallback = this.onMessageCallback
+    },
+    data() {
+      return {
+        tableHeaders: null,
+        tableData: null,
+        loading: true,
+        multipleSelection: [],
+        currentPage: 1,
+        totalPages: 1,
+        totalCount: 1,
+        pageSize: 20,
+        frontendServer: FRONTEND_SERVER,
+        baseDecLevels: baseInfo.decLevels(),
+        baseEmpLevels: baseInfo.empLevels(),
+        tool: tool,
+        permission: permission,
+        filterTypes: null,
+        filterModel: {},
+        dialogVisible: false,
+        formCloseLogin: {
+          userName: null,
+          typeName: '登录管理',
+          type: null,
+          isClose: 0,
+          remark: '',
+          areaSelected: null,
+        },
+        regionDataPlus: store.state.regionInfo.regionData,
+        apps: null,
+        closeSwitch: null,
+        submitButtonStat: false,
+        dialogDecVisible: false,
+        dialogModifyPasswordVisible: false,
+        dialogModifyProfileVisible: false,
+        formCloseDec: {
+          userName: null,
+          typeName: '管理报单',
+          type: null,
+          isClose: 0,
+          remark: '',
+          areaSelected: null,
+        },
+        formModifyPassword: {
+            userId:'',
+            password: '',
+            typeName: '修改密码',
+            passwordType: 'password',
+            // remark: '',
+        },
+        formModifyProfile: {
+            userId:'',
+            typeName: '修改个人资料',
+            nation: '',
+            realName: '',
+            idCard: '',
+            mobile: '',
+            openBank: '',
+            bankAddress: '',
+            bankNo: '',
+        },
+        passwordType: [
+            {
+                type:"password",
+                label:"登录密码"
+            },
+            {
+                type:"payPassword",
+                label:"支付密码"
+            },
+        ],
+        allOpenBank:null,
+        allNation:null,
+        submitDecButtonStat: false,
+        submitPasswordButtonStat: false,
+        submitProfileButtonStat: false,
+        transferPropForm: {
+          userIds: [],
+          allowTransfer: true,
+          transferProp: 100,
+          withdrawProp: 0,
+          remark: '',
+        },
+        closeUserData: null,
+      }
+    },
+    methods: {
       handleSelectionChange(val) {
-        this.multipleSelection = val
-      },
-      handleCurrentChange(page) {
-        this.getData(page, this.pageSize)
-      },
-      handleSizeChange(pageSize) {
-        this.getData(this.currentPage, pageSize)
-      },
-      handleAdd() {
-        this.$router.push('/user/user-add')
-      },
-      handleFilterUser(filterData) {
-        filterHelper.handleFilterUser(this, filterData)
-      },
-      handleFilter() {
-        this.getData()
-      },
-      getData(page, pageSize, isLoading = true) {
+
+        this.multipleSelection = val
+      },
+      handleCurrentChange(page) {
+        this.getData(page, this.pageSize)
+      },
+      handleSizeChange(pageSize) {
+        this.getData(this.currentPage, pageSize)
+      },
+      handleAdd() {
+        this.$router.push('/user/user-add')
+      },
+      handleFilterUser(filterData) {
+        filterHelper.handleFilterUser(this, filterData)
+      },
+      handleFilter() {
+        this.getData()
+      },
+      getData(page, pageSize, isLoading = true) {
         network.getPageData(this, 'user/index', page, pageSize, this.filterModel, response => {
-          this.filterTypes = response.filterTypes
-        }, isLoading)
-      },
-      handleGroupManage(isGroup) {
-        if (this.multipleSelection.length < 1) {
-          this.$message({
-            message: '请勾选要操作的会员',
-            type: 'warning'
-          })
-          return
-        }
-        let groupTip = isGroup === true ? '设为团队领导人' : '取消团队领导人'
-        this.$confirm(`确定要对所选会员【${groupTip}】吗?`, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          let selectedIds = []
-          for (let val of this.multipleSelection) {
-            selectedIds.push(val.USER_ID)
-          }
-          return network.postData(`user/is-group`, {userIds: selectedIds, isGroup: isGroup})
-        }).then(response => {
-          this.$message({
-            message: response,
-            type: 'success'
-          })
-          this.getData(this.currentPage, this.pageSize)
-        }).catch(response => {
-
-        })
-      },
-      handleIsDecManage(isDec) {
-          if (this.multipleSelection.length < 1) {
-              this.$message({
-                  message: '请勾选要操作的会员',
-                  type: 'warning'
-              })
-              return
-          }
-          let isDecTip = isDec === true ? '设为报单中心' : '取消报单中心'
-          this.$confirm(`确定要对所选会员【${isDecTip}】吗?`, '提示', {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning'
-          }).then(() => {
-              let selectedIds = []
-              for (let val of this.multipleSelection) {
-                  selectedIds.push(val.USER_ID)
-              }
-              return network.postData(`user/is-dec`, {userIds: selectedIds, isDec: isDec})
-          }).then(response => {
-              this.$message({
-                  message: response,
-                  type: 'success'
-              })
-              this.getData(this.currentPage, this.pageSize)
-          }).catch(response => {
-
-          })
-      },
-        handleIsStudioManage(isStudio) {
-            if (this.multipleSelection.length < 1) {
-                this.$message({
-                    message: '请勾选要操作的会员',
-                    type: 'warning'
-                })
-                return
-            }
-            let isStudioTip = isStudio === true ? '设为工作室' : '取消工作室'
-            this.$confirm(`确定要对所选会员【${isStudioTip}】吗?`, '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                let selectedIds = []
-                for (let val of this.multipleSelection) {
-                    selectedIds.push(val.USER_ID)
-                }
-                return network.postData(`user/is-studio`, {userIds: selectedIds, isStudio: isStudio})
-            }).then(response => {
-                this.$message({
-                    message: response,
-                    type: 'success'
-                })
-                this.getData(this.currentPage, this.pageSize)
-            }).catch(response => {
-
-            })
-        },
-        handleIsAtlasManage(isAtlas) {
-            if (this.multipleSelection.length < 1) {
-                this.$message({
-                    message: '请勾选要操作的会员',
-                    type: 'warning'
-                })
-                return
-            }
-            let isAtlasTip = isAtlas === true ? '显示图谱' : '隐藏图谱'
-            this.$confirm(`确定要对所选会员【${isAtlasTip}】吗?`, '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                let selectedIds = []
-                for (let val of this.multipleSelection) {
-                    selectedIds.push(val.USER_ID)
-                }
-                return network.postData(`user/is-atlas`, {userIds: selectedIds, isAtlas: isAtlas})
-            }).then(response => {
-                this.$message({
-                    message: response,
-                    type: 'success'
-                })
-                this.getData(this.currentPage, this.pageSize)
-            }).catch(response => {
-
-            })
-        },
-        handleIsRechargeManage(isRecharge) {
-            if (this.multipleSelection.length < 1) {
-                this.$message({
-                    message: '请勾选要操作的会员',
-                    type: 'warning'
-                })
-                return
-            }
-            let isRechargeTip = isRecharge === true ? '显示充值' : '隐藏充值'
-            this.$confirm(`确定要对所选会员【${isRechargeTip}】吗?`, '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                let selectedIds = []
-                for (let val of this.multipleSelection) {
-                    selectedIds.push(val.USER_ID)
-                }
-                return network.postData(`user/is-recharge`, {userIds: selectedIds, isRecharge: isRecharge})
-            }).then(response => {
-                this.$message({
-                    message: response,
-                    type: 'success'
-                })
-                this.getData(this.currentPage, this.pageSize)
-            }).catch(response => {
-
-            })
-        },
-      getTypeName(type) {
-        switch (type) {
-          case 1:
-            return '按指定会员'
-          case 2:
-            return '按开拓网络'
-          case 3:
-            return '按安置网络'
-          case 4:
-            return '按会员体系'
-          case 5:
-            return '按省份地区'
-          default:
-            return ''
-        }
-      },
-      handleLoginManage(type) {
-        if (type === 2 || type === 3 || type === 4) {
-          if (this.multipleSelection.length > 1) {
-            this.$message({
-              message: '此登录管理不允许勾选多名会员',
-              type: 'warning'
-            })
-            return;
-          } else if (this.multipleSelection.length < 1) {
-            this.$message({
-              message: '请选择会员编号',
-              type: 'warning'
-            })
-            return;
-          }
-        }
-        if (type === 1 && this.multipleSelection.length <= 0) {
-          this.$message({
-            message: '请选择会员编号',
-            type: 'warning'
-          })
-          return;
-        }
-        if (type === 5 && this.multipleSelection.length > 0) {
-          this.$message({
-            message: '按照地区关闭登录无需勾选会员',
-            type: 'warning'
-          })
-          return;
-        }
-        this.formCloseLogin = {
-          userName: null,
-          typeName: '登录管理',
-          type: null,
-          isClose: 0,
-          remark: '',
-          areaSelected: null,
-        },
-          this.formCloseLogin.typeName = this.getTypeName(type) + '管理登录'
-        this.formCloseLogin.type = type
-        this.dialogVisible = true
-      },
-      handleCloseLoginSubmit() {
-        this.submitButtonStat = true
-        // 获取所购选的会员,如果是批量关闭指定会员,则走批量关闭方法
-        if (this.formCloseLogin.type === 1) {
-          this.handleCloseLogin(this.formCloseLogin.isClose, this.formCloseLogin.remark)
-        } else {
-          for (let val of this.multipleSelection) {
-            this.formCloseLogin.userName = val.USER_NAME.value
-          }
-          let path = 'user/close-login'
-          if (this.formCloseLogin.type === 5) {
-            path = 'user/close-area-login'
-          }
-          network.postData(path, this.formCloseLogin).then(response => {
-            this.$message({
-              message: response,
-              type: 'success'
-            })
-            this.getData(this.currentPage, this.pageSize)
-            this.submitButtonStat = false
-            this.dialogVisible = false
-          }).catch(response => {
-            this.submitButtonStat = false
-          })
-        }
-      },
-      handleCloseLogin(isClose, remark = '') {
-        let selectedIds = []
-        for (let val of this.multipleSelection) {
-          selectedIds.push(val.USER_ID)
-        }
-        console.log(selectedIds);
-        network.postData(`user/batch-close-login`, {
-          userIds: selectedIds,
-          isClose: isClose,
-          remark: remark,
-          type: 1,
-        }).then(response => {
-          this.$message({
-            message: response,
-            type: 'success'
-          })
-          this.getData(this.currentPage, this.pageSize)
-          this.submitButtonStat = false
-          this.dialogVisible = false
-        }).catch(response => {
-          this.submitButtonStat = false
-        })
-        // let tipStr = isClose ? '禁止' : '允许'
-        // this.$confirm(`确定要${tipStr}所选会员登录?`, '提示', {
-        //   confirmButtonText: '确定',
-        //   cancelButtonText: '取消',
-        //   type: 'warning'
-        // }).then(() => {
-        //   return network.postData(`user/batch-close-login`, {userIds: selectedIds, isClose: isClose})
-        // }).then(response => {
-        //   this.$message({
-        //     message: response,
-        //     type: 'success'
-        //   })
-        //   this.getData(this.currentPage, this.pageSize)
-        // }).catch(response => {
-        //
-        // })
-      },
-      handleExport() {
-        this.$confirm(`确定要导出当前数据吗?`, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          return network.getData(`user/index-export`, this.filterModel)
-        }).then(response => {
-          this.$message({
-            message: response,
-            type: 'success'
-          })
-        }).catch(response => {
-
-        })
-      },
-      onMessageCallback(data) {
-        //this.getData(this.currentPage, this.pageSize, false)
-      },
-      handleDecManage(type) {
-        if (type === 2 || type === 3 || type === 4) {
-          if (this.multipleSelection.length > 1) {
-            this.$message({
-              message: '此报单管理不允许勾选多名会员',
-              type: 'warning'
-            })
-            return;
-          } else if (this.multipleSelection.length < 1) {
-            this.$message({
-              message: '请勾选要管理报单的会员',
-              type: 'warning'
-            })
-            return;
-          }
-        }
-        if (type === 1 && this.multipleSelection.length <= 0) {
-          this.$message({
-            message: '请勾选要管理报单的会员',
-            type: 'warning'
-          })
-          return;
-        }
-        if (type === 5 && this.multipleSelection.length > 0) {
-          this.$message({
-            message: '按照地区关闭报单无需勾选会员',
-            type: 'warning'
-          })
-          return;
-        }
-        this.formCloseDec = {
-          userName: null,
-          typeName: '管理报单',
-          type: null,
-          isClose: 0,
-          remark: '',
-          areaSelected: null,
-        },
-          this.formCloseDec.typeName = this.getTypeName(type) + '管理报单'
-        this.formCloseDec.type = type
-        this.dialogDecVisible = true
-      },
-      handleModifyPassword(row){
-        this.formModifyPassword.userId = row.USER_ID;
-        this.dialogModifyPasswordVisible = true
-      },
-      handleModifyProfile(row){
-          this.dialogModifyProfileVisible = true
-          let vueObj = this
-          network.getData('user/profile-get', {id: row.USER_ID}).then(response => {
-              vueObj.formModifyProfile = response.userInfo
-              vueObj.allOpenBank = response.allOpenBank
-              vueObj.allNation = response.allNation
-          })
-      },
-      handleCloseDecSubmit() {
-        this.submitDecButtonStat = true
-        // 获取所购选的会员,如果是批量关闭指定会员,则走批量关闭方法
-        if (this.formCloseDec.type === 1) {
-          this.handleCloseDec(this.formCloseDec.isClose, this.formCloseDec.remark)
-        } else {
-          for (let val of this.multipleSelection) {
-            this.formCloseDec.userName = val.USER_NAME.value
-          }
-          let path = 'user/close-dec'
-          if (this.formCloseDec.type === 5) {
-            path = 'user/close-area-dec'
-          }
-          network.postData(path, this.formCloseDec).then(response => {
-            this.$message({
-              message: response,
-              type: 'success'
-            })
-            this.getData(this.currentPage, this.pageSize)
-            this.submitDecButtonStat = false
-            this.dialogDecVisible = false
-          }).catch(response => {
-            this.submitDecButtonStat = false
-          })
-        }
-      },
-      handleCloseDec(isClose, remark = '') {
-        let selectedIds = []
-        for (let val of this.multipleSelection) {
-          selectedIds.push(val.USER_ID)
-        }
-        network.postData(`user/batch-close-dec`, {
-          userIds: selectedIds,
-          isClose: isClose,
-          remark: remark,
-          type: 1,
-        }).then(response => {
-          this.$message({
-            message: response,
-            type: 'success'
-          })
-          this.getData(this.currentPage, this.pageSize)
-          this.submitDecButtonStat = false
-          this.dialogDecVisible = false
-        }).catch(response => {
-          this.submitDecButtonStat = false
-        })
-      },
-        handleStatusActive(row){
-            network.postData('user/modify-status',{userId:row.USER_ID,status:1}).then(response=>{
-                    this.$message({
-                        message: response,
-                        type: 'success'
-                    })
-                    this.getData(this.currentPage, this.pageSize)
-                })
-        },
-        handleStatusLock(row){
-            network.postData('user/modify-status',{userId:row.USER_ID,status:0}).then(response=>{
-                    this.$message({
-                        message: response,
-                        type: 'success'
-                    })
-                    this.getData(this.currentPage, this.pageSize)
-                })
-        },
-        handleIsModifyPassword(row, status){
-          network.postData('user/is-modify-password-status',{userId:row.USER_ID,status:status}).then(response=>{
-            this.$message({
-              message: response,
-              type: 'success'
-            })
-            this.getData(this.currentPage, this.pageSize)
-          })
-        },
-      handleModifyPasswordSubmit() {
-            this.submitPasswordButtonStat = true
-              let path = 'user/modify-password'
-              network.postData(path, this.formModifyPassword).then(response => {
-                  this.$message({
-                      message: response,
-                      type: 'success'
-                  })
-                  this.getData(this.currentPage, this.pageSize)
-                  this.submitPasswordButtonStat = false
-                  this.dialogModifyPasswordVisible = false
-              }).catch(response => {
-                  this.submitPasswordButtonStat = false
-              })
-        },
-        handleModifyProfileSubmit() {
-            this.submitProfileButtonStat = true
-            let path = 'user/modify-profile'
-            network.postData(path, this.formModifyProfile).then(response => {
-                this.$message({
-                    message: response,
-                    type: 'success'
-                })
-                this.getData(this.currentPage, this.pageSize)
-                this.submitProfileButtonStat = false
-                this.dialogModifyProfileVisible = false
-            }).catch(response => {
-                this.submitProfileButtonStat = false
-            })
-        },
-    }
-  }
-
-</script>
-
+          console.log(response.filterTypes);
+          this.filterTypes = response.filterTypes
+        }, isLoading)
+      },
+      handleGroupManage(isGroup) {
+        if (this.multipleSelection.length < 1) {
+          this.$message({
+            message: '请勾选要操作的会员',
+            type: 'warning'
+          })
+          return
+        }
+        let groupTip = isGroup === true ? '设为团队领导人' : '取消团队领导人'
+        this.$confirm(`确定要对所选会员【${groupTip}】吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          let selectedIds = []
+          for (let val of this.multipleSelection) {
+            selectedIds.push(val.USER_ID)
+          }
+          return network.postData(`user/is-group`, {userIds: selectedIds, isGroup: isGroup})
+        }).then(response => {
+          this.$message({
+            message: response,
+            type: 'success'
+          })
+          this.getData(this.currentPage, this.pageSize)
+        }).catch(response => {
+
+        })
+      },
+      handleIsDecManage(isDec) {
+          if (this.multipleSelection.length < 1) {
+              this.$message({
+                  message: '请勾选要操作的会员',
+                  type: 'warning'
+              })
+              return
+          }
+          let isDecTip = isDec === true ? '设为报单中心' : '取消报单中心'
+          this.$confirm(`确定要对所选会员【${isDecTip}】吗?`, '提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning'
+          }).then(() => {
+              let selectedIds = []
+              for (let val of this.multipleSelection) {
+                  selectedIds.push(val.USER_ID)
+              }
+              return network.postData(`user/is-dec`, {userIds: selectedIds, isDec: isDec})
+          }).then(response => {
+              this.$message({
+                  message: response,
+                  type: 'success'
+              })
+              this.getData(this.currentPage, this.pageSize)
+          }).catch(response => {
+
+          })
+      },
+        handleIsStudioManage(isStudio) {
+            if (this.multipleSelection.length < 1) {
+                this.$message({
+                    message: '请勾选要操作的会员',
+                    type: 'warning'
+                })
+                return
+            }
+            let isStudioTip = isStudio === true ? '设为工作室' : '取消工作室'
+            this.$confirm(`确定要对所选会员【${isStudioTip}】吗?`, '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                let selectedIds = []
+                for (let val of this.multipleSelection) {
+                    selectedIds.push(val.USER_ID)
+                }
+                return network.postData(`user/is-studio`, {userIds: selectedIds, isStudio: isStudio})
+            }).then(response => {
+                this.$message({
+                    message: response,
+                    type: 'success'
+                })
+                this.getData(this.currentPage, this.pageSize)
+            }).catch(response => {
+
+            })
+        },
+        handleIsAtlasManage(isAtlas) {
+            if (this.multipleSelection.length < 1) {
+                this.$message({
+                    message: '请勾选要操作的会员',
+                    type: 'warning'
+                })
+                return
+            }
+            let isAtlasTip = isAtlas === true ? '显示图谱' : '隐藏图谱'
+            this.$confirm(`确定要对所选会员【${isAtlasTip}】吗?`, '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                let selectedIds = []
+                for (let val of this.multipleSelection) {
+                    selectedIds.push(val.USER_ID)
+                }
+                return network.postData(`user/is-atlas`, {userIds: selectedIds, isAtlas: isAtlas})
+            }).then(response => {
+                this.$message({
+                    message: response,
+                    type: 'success'
+                })
+                this.getData(this.currentPage, this.pageSize)
+            }).catch(response => {
+
+            })
+        },
+        handleIsRechargeManage(isRecharge) {
+            if (this.multipleSelection.length < 1) {
+                this.$message({
+                    message: '请勾选要操作的会员',
+                    type: 'warning'
+                })
+                return
+            }
+            let isRechargeTip = isRecharge === true ? '显示充值' : '隐藏充值'
+            this.$confirm(`确定要对所选会员【${isRechargeTip}】吗?`, '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                let selectedIds = []
+                for (let val of this.multipleSelection) {
+                    selectedIds.push(val.USER_ID)
+                }
+                return network.postData(`user/is-recharge`, {userIds: selectedIds, isRecharge: isRecharge})
+            }).then(response => {
+                this.$message({
+                    message: response,
+                    type: 'success'
+                })
+                this.getData(this.currentPage, this.pageSize)
+            }).catch(response => {
+
+            })
+        },
+      getTypeName(type) {
+        switch (type) {
+          case 1:
+            return '按指定会员'
+          case 2:
+            return '按开拓网络'
+          case 3:
+            return '按安置网络'
+          case 4:
+            return '按会员体系'
+          case 5:
+            return '按省份地区'
+          default:
+            return ''
+        }
+      },
+      handleLoginManage(type) {
+        if (type === 2 || type === 3 || type === 4) {
+          if (this.multipleSelection.length > 1) {
+            this.$message({
+              message: '此登录管理不允许勾选多名会员',
+              type: 'warning'
+            })
+            return;
+          } else if (this.multipleSelection.length < 1) {
+            this.$message({
+              message: '请选择会员编号',
+              type: 'warning'
+            })
+            return;
+          }
+        }
+        if (type === 1 && this.multipleSelection.length <= 0) {
+          this.$message({
+            message: '请选择会员编号',
+            type: 'warning'
+          })
+          return;
+        }
+        if (type === 5 && this.multipleSelection.length > 0) {
+          this.$message({
+            message: '按照地区关闭登录无需勾选会员',
+            type: 'warning'
+          })
+          return;
+        }
+        this.formCloseLogin = {
+          userName: null,
+          typeName: '登录管理',
+          type: null,
+          isClose: 0,
+          remark: '',
+          areaSelected: null,
+        },
+          this.formCloseLogin.typeName = this.getTypeName(type) + '管理登录'
+        this.formCloseLogin.type = type
+        this.dialogVisible = true
+      },
+      handleCloseLoginSubmit() {
+        this.submitButtonStat = true
+        // 获取所购选的会员,如果是批量关闭指定会员,则走批量关闭方法
+        if (this.formCloseLogin.type === 1) {
+          this.handleCloseLogin(this.formCloseLogin.isClose, this.formCloseLogin.remark)
+        } else {
+          for (let val of this.multipleSelection) {
+            this.formCloseLogin.userName = val.USER_NAME.value
+          }
+          let path = 'user/close-login'
+          if (this.formCloseLogin.type === 5) {
+            path = 'user/close-area-login'
+          }
+          network.postData(path, this.formCloseLogin).then(response => {
+            this.$message({
+              message: response,
+              type: 'success'
+            })
+            this.getData(this.currentPage, this.pageSize)
+            this.submitButtonStat = false
+            this.dialogVisible = false
+          }).catch(response => {
+            this.submitButtonStat = false
+          })
+        }
+      },
+      handleCloseLogin(isClose, remark = '') {
+        let selectedIds = []
+        for (let val of this.multipleSelection) {
+          selectedIds.push(val.USER_ID)
+        }
+        console.log(selectedIds);
+        network.postData(`user/batch-close-login`, {
+          userIds: selectedIds,
+          isClose: isClose,
+          remark: remark,
+          type: 1,
+        }).then(response => {
+          this.$message({
+            message: response,
+            type: 'success'
+          })
+          this.getData(this.currentPage, this.pageSize)
+          this.submitButtonStat = false
+          this.dialogVisible = false
+        }).catch(response => {
+          this.submitButtonStat = false
+        })
+        // let tipStr = isClose ? '禁止' : '允许'
+        // this.$confirm(`确定要${tipStr}所选会员登录?`, '提示', {
+        //   confirmButtonText: '确定',
+        //   cancelButtonText: '取消',
+        //   type: 'warning'
+        // }).then(() => {
+        //   return network.postData(`user/batch-close-login`, {userIds: selectedIds, isClose: isClose})
+        // }).then(response => {
+        //   this.$message({
+        //     message: response,
+        //     type: 'success'
+        //   })
+        //   this.getData(this.currentPage, this.pageSize)
+        // }).catch(response => {
+        //
+        // })
+      },
+      handleExport() {
+        this.$confirm(`确定要导出当前数据吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          return network.getData(`user/index-export`, this.filterModel)
+        }).then(response => {
+          this.$message({
+            message: response,
+            type: 'success'
+          })
+        }).catch(response => {
+
+        })
+      },
+      onMessageCallback(data) {
+        //this.getData(this.currentPage, this.pageSize, false)
+      },
+      handleDecManage(type) {
+        if (type === 2 || type === 3 || type === 4) {
+          if (this.multipleSelection.length > 1) {
+            this.$message({
+              message: '此报单管理不允许勾选多名会员',
+              type: 'warning'
+            })
+            return;
+          } else if (this.multipleSelection.length < 1) {
+            this.$message({
+              message: '请勾选要管理报单的会员',
+              type: 'warning'
+            })
+            return;
+          }
+        }
+        if (type === 1 && this.multipleSelection.length <= 0) {
+          this.$message({
+            message: '请勾选要管理报单的会员',
+            type: 'warning'
+          })
+          return;
+        }
+        if (type === 5 && this.multipleSelection.length > 0) {
+          this.$message({
+            message: '按照地区关闭报单无需勾选会员',
+            type: 'warning'
+          })
+          return;
+        }
+        this.formCloseDec = {
+          userName: null,
+          typeName: '管理报单',
+          type: null,
+          isClose: 0,
+          remark: '',
+          areaSelected: null,
+        },
+          this.formCloseDec.typeName = this.getTypeName(type) + '管理报单'
+        this.formCloseDec.type = type
+        this.dialogDecVisible = true
+      },
+      handleModifyPassword(row){
+        this.formModifyPassword.userId = row.USER_ID;
+        this.dialogModifyPasswordVisible = true
+      },
+      handleModifyProfile(row){
+          this.dialogModifyProfileVisible = true
+          let vueObj = this
+          network.getData('user/profile-get', {id: row.USER_ID}).then(response => {
+              vueObj.formModifyProfile = response.userInfo
+              vueObj.allOpenBank = response.allOpenBank
+              vueObj.allNation = response.allNation
+          })
+      },
+      handleCloseDecSubmit() {
+        this.submitDecButtonStat = true
+        // 获取所购选的会员,如果是批量关闭指定会员,则走批量关闭方法
+        if (this.formCloseDec.type === 1) {
+          this.handleCloseDec(this.formCloseDec.isClose, this.formCloseDec.remark)
+        } else {
+          for (let val of this.multipleSelection) {
+            this.formCloseDec.userName = val.USER_NAME.value
+          }
+          let path = 'user/close-dec'
+          if (this.formCloseDec.type === 5) {
+            path = 'user/close-area-dec'
+          }
+          network.postData(path, this.formCloseDec).then(response => {
+            this.$message({
+              message: response,
+              type: 'success'
+            })
+            this.getData(this.currentPage, this.pageSize)
+            this.submitDecButtonStat = false
+            this.dialogDecVisible = false
+          }).catch(response => {
+            this.submitDecButtonStat = false
+          })
+        }
+      },
+      handleCloseDec(isClose, remark = '') {
+        let selectedIds = []
+        for (let val of this.multipleSelection) {
+          selectedIds.push(val.USER_ID)
+        }
+        network.postData(`user/batch-close-dec`, {
+          userIds: selectedIds,
+          isClose: isClose,
+          remark: remark,
+          type: 1,
+        }).then(response => {
+          this.$message({
+            message: response,
+            type: 'success'
+          })
+          this.getData(this.currentPage, this.pageSize)
+          this.submitDecButtonStat = false
+          this.dialogDecVisible = false
+        }).catch(response => {
+          this.submitDecButtonStat = false
+        })
+      },
+        handleStatusActive(row){
+            network.postData('user/modify-status',{userId:row.USER_ID,status:1}).then(response=>{
+                    this.$message({
+                        message: response,
+                        type: 'success'
+                    })
+                    this.getData(this.currentPage, this.pageSize)
+                })
+        },
+        handleStatusLock(row){
+            network.postData('user/modify-status',{userId:row.USER_ID,status:0}).then(response=>{
+                    this.$message({
+                        message: response,
+                        type: 'success'
+                    })
+                    this.getData(this.currentPage, this.pageSize)
+                })
+        },
+        handleIsModifyPassword(row, status){
+          network.postData('user/is-modify-password-status',{userId:row.USER_ID,status:status}).then(response=>{
+            this.$message({
+              message: response,
+              type: 'success'
+            })
+            this.getData(this.currentPage, this.pageSize)
+          })
+        },
+      handleModifyPasswordSubmit() {
+            this.submitPasswordButtonStat = true
+              let path = 'user/modify-password'
+              network.postData(path, this.formModifyPassword).then(response => {
+                  this.$message({
+                      message: response,
+                      type: 'success'
+                  })
+                  this.getData(this.currentPage, this.pageSize)
+                  this.submitPasswordButtonStat = false
+                  this.dialogModifyPasswordVisible = false
+              }).catch(response => {
+                  this.submitPasswordButtonStat = false
+              })
+        },
+        handleModifyProfileSubmit() {
+            this.submitProfileButtonStat = true
+            let path = 'user/modify-profile'
+            network.postData(path, this.formModifyProfile).then(response => {
+                this.$message({
+                    message: response,
+                    type: 'success'
+                })
+                this.getData(this.currentPage, this.pageSize)
+                this.submitProfileButtonStat = false
+                this.dialogModifyProfileVisible = false
+            }).catch(response => {
+                this.submitProfileButtonStat = false
+            })
+        },
+    }
+  }
+
+</script>

+ 52 - 52
common/components/Controller.php

@@ -1,53 +1,53 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: Leo
- * Date: 2017/9/3
- * Time: 下午3:05
- */
-
-namespace common\components;
-
-
-use common\helpers\Tool;
-use yii\base\ActionEvent;
-use yii\helpers\Json;
-use yii\helpers\Url;
-
-class Controller extends \yii\web\Controller {
-
-    /**
-     * @return array
-     */
-    public function actions() {
-        return [
-            'captcha' =>  [
-                'class' => 'common\helpers\CaptchaAction',
-                'width' => 120,
-                'height' => 40,
-                'padding' => 0,
-                'minLength' => 4,
-                'maxLength' => 4,
-                'offset'=>8,        //设置字符偏移量 有效果
-                'testLimit'=>1,
-            ],
-        ];
-    }
-
-    /**
-     * 不允许直接访问ajax页面
-     * @param $action
-     * @return bool
-     * @throws \yii\web\BadRequestHttpException
-     */
-    protected function checkAjax(&$action){
-        $currentAction = $action->id;
-        if(strpos($currentAction ,'ajax-')===0){
-            if(!\Yii::$app->request->getIsAjax()){
-                throw new \yii\web\BadRequestHttpException('无法完成您的请求');
-            }
-        }
-        return true;
-    }
-
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Leo
+ * Date: 2017/9/3
+ * Time: 下午3:05
+ */
+
+namespace common\components;
+
+
+use common\helpers\Tool;
+use yii\base\ActionEvent;
+use yii\helpers\Json;
+use yii\helpers\Url;
+
+class Controller extends \yii\web\Controller {
+
+    /**
+     * @return array
+     */
+    public function actions() {
+        return [
+            'captcha' =>  [
+                'class' => 'common\helpers\CaptchaAction',
+                'width' => 120,
+                'height' => 40,
+                'padding' => 0,
+                'minLength' => 4,
+                'maxLength' => 4,
+                'offset'=>8,        //设置字符偏移量 有效果
+                'testLimit'=>1,
+            ],
+        ];
+    }
+
+    /**
+     * 不允许直接访问ajax页面
+     * @param $action
+     * @return bool
+     * @throws \yii\web\BadRequestHttpException
+     */
+    protected function checkAjax(&$action){
+        $currentAction = $action->id;
+        if(strpos($currentAction ,'ajax-')===0){
+            if(!\Yii::$app->request->getIsAjax()){
+                throw new \yii\web\BadRequestHttpException('无法完成您的请求');
+            }
+        }
+        return true;
+    }
+
 }

+ 69 - 58
common/config/main.php

@@ -1,58 +1,69 @@
-<?php
-$mainConfig = require_once __DIR__ . '/config.php';
-return [
-    'language' => 'zh-CN',
-    'timeZone' => 'PRC',
-    'aliases' => [
-        '@bower' => '@vendor/bower-asset',
-        '@npm'   => '@vendor/npm-asset',
-//        'anlity/swooleAsyncTimer' => '@backend/runtime/tmp-extensions/yii2-swoole-async-timer',
-    ],
-    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
-    'components' => [
-        'db' => array_merge([
-            'class' => 'yii\db\Connection',
-            'enableSlaves' => false,
-//            'enableSavepoint' => false,
-        ], $mainConfig['db'], $mainConfig['slavesDb']),
-//        'dbShop' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema']], $mainConfig['dbShop']),
-        'dbLog' => array_merge(['class' => 'yii\mongodb\Connection',], $mainConfig['dbLog']),
-        'dbCalc' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalc']),
-//        'dbShopCalc' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema'],], $mainConfig['dbShopCalc']),
-        'dbNetPoint' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbNetPoint']),
-        // 'cache' => [
-        //     //'class' => 'yii\caching\FileCache',
-        //     'class' => 'dcb9\redis\Cache',
-        //     'redis' => $mainConfig['cacheRedis'],
-        // ],
-        'cache' => [
-            'class' => 'yii\redis\Cache',
-            'redis' => $mainConfig['cacheRedis'],
-            // 'redis' => [
-            //     'hostname' => '127.0.0.1',
-            //     'port' => 6379,
-            //     'database' => 0,
-            // ]
-        ],
-        'tokenRedis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['tokenRedis']),
-        'redis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['otherRedis']),
-        // 'tokenRedis' => array_merge(['class' => 'common\components\Redis'], $mainConfig['tokenRedis']),
-        // 'redis' => array_merge(['class' => 'common\components\Redis'], $mainConfig['otherRedis']),
-        'mailer' => [
-            'class' => 'yii\swiftmailer\Mailer',
-            'viewPath' => '@common/mail',
-            // send all mails to a file by default. You have to set
-            // 'useFileTransport' to false and configure a transport
-            // for the mailer to send real emails.
-            'useFileTransport' => true,
-        ],
-        'swooleAsyncTimer' => [
-            'class' => 'common\components\SwooleAsyncTimer',
-        ],
-    ],
-    'controllerMap' => [
-        'swoole_server' => [
-            'class' => 'anlity\swooleAsyncTimer\SwooleAsyncTimerController',
-        ],
-    ],
-];
+<?php
+$mainConfig = require_once __DIR__ . '/config.php';
+return [
+    'language' => 'zh-CN',
+    'timeZone' => 'PRC',
+    'aliases' => [
+        '@bower' => '@vendor/bower-asset',
+        '@npm'   => '@vendor/npm-asset',
+//        'anlity/swooleAsyncTimer' => '@backend/runtime/tmp-extensions/yii2-swoole-async-timer',
+    ],
+    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
+    'components' => [
+//        'log' => [
+//            'targets' => [
+//                [
+//                    'class' => 'yii\log\FileTarget',
+//                    'levels' => ['error', 'warning', 'info'],
+//                    'categories' => ['yii\db\*', 'app\models\*'],
+//                    'logFile' => '@runtime/logs/sql.log',
+//                ],
+//                'db' => [ 'class' => 'yii\log\FileTarget'],
+//            ],
+//        ],
+        'db' => array_merge([
+            'class' => 'yii\db\Connection',
+            'enableSlaves' => false,
+//            'enableSavepoint' => false,
+        ], $mainConfig['db'], $mainConfig['slavesDb']),
+//        'dbShop' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema']], $mainConfig['dbShop']),
+        'dbLog' => array_merge(['class' => 'yii\mongodb\Connection',], $mainConfig['dbLog']),
+        'dbCalc' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalc']),
+//        'dbShopCalc' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema'],], $mainConfig['dbShopCalc']),
+        'dbNetPoint' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbNetPoint']),
+        // 'cache' => [
+        //     //'class' => 'yii\caching\FileCache',
+        //     'class' => 'dcb9\redis\Cache',
+        //     'redis' => $mainConfig['cacheRedis'],
+        // ],
+        'cache' => [
+            'class' => 'yii\redis\Cache',
+            'redis' => $mainConfig['cacheRedis'],
+            // 'redis' => [
+            //     'hostname' => '127.0.0.1',
+            //     'port' => 6379,
+            //     'database' => 0,
+            // ]
+        ],
+        'tokenRedis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['tokenRedis']),
+        'redis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['otherRedis']),
+        // 'tokenRedis' => array_merge(['class' => 'common\components\Redis'], $mainConfig['tokenRedis']),
+        // 'redis' => array_merge(['class' => 'common\components\Redis'], $mainConfig['otherRedis']),
+        'mailer' => [
+            'class' => 'yii\swiftmailer\Mailer',
+            'viewPath' => '@common/mail',
+            // send all mails to a file by default. You have to set
+            // 'useFileTransport' to false and configure a transport
+            // for the mailer to send real emails.
+            'useFileTransport' => true,
+        ],
+        'swooleAsyncTimer' => [
+            'class' => 'common\components\SwooleAsyncTimer',
+        ],
+    ],
+    'controllerMap' => [
+        'swoole_server' => [
+            'class' => 'anlity\swooleAsyncTimer\SwooleAsyncTimerController',
+        ],
+    ],
+];

+ 1 - 1
common/config/params.php

@@ -200,7 +200,7 @@ return [
         ],
         'exchange_points' => [
             'name' => 'bonus',
-            'label' => '兑换积分余额',
+            'label' => '兑换点数余额',
         ]
 //        'cf' => [
 //            'name' => 'cf',

+ 156 - 156
common/helpers/CaptchaAction.php

@@ -1,157 +1,157 @@
-<?php
-namespace common\helpers;
-
-use Yii;
-use yii\helpers\Url;
-use yii\web\Response;
-
-/**
- * 验证码扩展类
- * @author   Leo
- * @copyright  Copyright (c) 2016 (http://www.LeoCode.net)
- */
-class CaptchaAction extends \yii\captcha\CaptchaAction
-{
-
-    const CAPTCHA_CODE = 'ak:captcha_code_%s';
-
-    /**
-     * GD库方式渲染
-     * @param string $code
-     * @return string
-     */
-    protected function renderImageByGD($code)
-    {
-        $this->fontFile = Yii::getAlias('@common/helpers/font/DroidSansMono.ttf');
-        $image = imagecreatetruecolor($this->width, $this->height);
-        $backColor = imagecolorallocate(
-            $image,
-            (int)($this->backColor % 0x1000000 / 0x10000),
-            (int)($this->backColor % 0x10000 / 0x100),
-            $this->backColor % 0x100
-        );
-        imagefilledrectangle($image, 0, 0, $this->width - 1, $this->height - 1, $backColor);
-        imagecolordeallocate($image, $backColor);
-        $this->transparent = true;
-        if ($this->transparent) {
-            imagecolortransparent($image, $backColor);
-        }
-
-        $foreColor = imagecolorallocate(
-            $image,
-            (int)($this->foreColor % 0x1000000 / 0x10000),
-            (int)($this->foreColor % 0x10000 / 0x100),
-            $this->foreColor % 0x100
-        );
-
-        $length = strlen($code);
-        $box = imagettfbbox(30, 0, $this->fontFile, $code);
-        $w = $box[4] - $box[0] + $this->offset * ($length - 1);
-        $h = $box[1] - $box[5];
-        $scale = min(($this->width - $this->padding * 2) / $w, ($this->height - $this->padding * 2) / $h);
-        $x = 10;
-        $y = round($this->height * 27 / 40);
-
-        // 添加彩色乱字符
-        $chartDictionary = 'abcdefghjkmnopqrstuvwxyzABCDEFGHJKMNOPQRSTUVWXYZ2345679';
-        for ($i = 0; $i < 50; $i++) {
-            $chartPosition = rand(0, strlen($chartDictionary));
-            $chartContent = substr($chartDictionary, $chartPosition, 1);
-            $chartColor = imagecolorallocate($image, mt_rand(150, 255), mt_rand(150, 255), mt_rand(150, 255));
-            $chartAngle = rand(-10, 10);
-            imagettftext($image, 10, $chartAngle, rand(0, ($this->width - $this->padding * 2) - 10), rand(0, ($this->height - $this->padding * 2) - 10), $chartColor, $this->fontFile, $chartContent);
-        }
-
-        // 设置文字
-        for ($i = 0; $i < $length; ++$i) {
-            $fontSize = (int)(rand(26, 32) * $scale * 0.8);
-            $angle = rand(-10, 10);
-            $letter = $code[$i];
-            $box = imagettftext($image, $fontSize, $angle, $x, $y, $foreColor, $this->fontFile, $letter);
-            $x = $box[2] + $this->offset;
-        }
-
-        // 验证码添加线条
-        for ($i = 0; $i < 10; $i++) {
-            $lineColor = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
-            imageline($image, rand(0, 2), rand(0, ($this->width - $this->height * 2) - 2), rand(0, ($this->width - $this->padding * 2) - 2), rand(0, ($this->width - $this->height * 2) - 2), $lineColor);
-        }
-
-        // 验证码添加噪点
-        for ($i = 0; $i < 300; $i++) {
-            //设置点的颜色
-            $pointColor = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
-            imagesetpixel($image, rand(0, ($this->width - $this->padding * 2)), rand(0, ($this->width - $this->height * 2) - 10), $pointColor);
-        }
-
-        imagecolordeallocate($image, $foreColor);
-
-        ob_start();
-        imagepng($image);
-        imagedestroy($image);
-
-        return ob_get_clean();
-    }
-
-    /**
-     * Runs the action.
-     */
-    public function run()
-    {
-        if (Yii::$app->request->getQueryParam(self::REFRESH_GET_VAR) !== null) {
-            // AJAX request for regenerating code
-            $code = $this->getVerifyCode(true);
-            Yii::$app->response->format = Response::FORMAT_JSON;
-            return [
-                'hash1' => $this->generateValidationHash($code),
-                'hash2' => $this->generateValidationHash(strtolower($code)),
-                // we add a random 'v' parameter so that FireFox can refresh the image
-                // when src attribute of image tag is changed
-                'url' => Url::to([$this->id, 'v' => uniqid()]),
-            ];
-        } else {
-            $this->setHttpHeaders();
-            Yii::$app->response->format = Response::FORMAT_RAW;
-            return $this->renderImage($this->getVerifyCode(true));
-        }
-    }
-
-    /**
-     * @param bool $regenerate
-     * @return int|mixed|string|null
-     */
-    public function getVerifyCode($regenerate = false)
-    {
-        if ($this->fixedVerifyCode !== null) {
-            return $this->fixedVerifyCode;
-        }
-//        $name = $this->getSessionKey();
-        $pageId = \Yii::$app->request->get('page_id');
-        if( !$pageId ) {
-            throw new \Exception('no page id');
-        }
-
-        $cacheRedis = Yii::$app->cache;
-        $key = sprintf(self::CAPTCHA_CODE, $pageId);
-        if( !$regenerate ) {
-            $code = $cacheRedis->get($key);
-            if ( $code ) return $code;
-        }
-
-        $code = $this->generateVerifyCode();
-        $cacheRedis->set($key, $code, 300);
-
-        return $code;
-    }
-
-    public function validate($input, $caseSensitive)
-    {
-        $code = $this->getVerifyCode();
-        $valid = $caseSensitive ? ($input === $code) : strcasecmp($input, $code) === 0;
-        if ( $valid ) {
-            $this->getVerifyCode(true);
-        }
-
-        return $valid;
-    }
+<?php
+namespace common\helpers;
+
+use Yii;
+use yii\helpers\Url;
+use yii\web\Response;
+
+/**
+ * 验证码扩展类
+ * @author   Leo
+ * @copyright  Copyright (c) 2016 (http://www.LeoCode.net)
+ */
+class CaptchaAction extends \yii\captcha\CaptchaAction
+{
+
+    const CAPTCHA_CODE = 'ak:captcha_code_%s';
+
+    /**
+     * GD库方式渲染
+     * @param string $code
+     * @return string
+     */
+    protected function renderImageByGD($code)
+    {
+        $this->fontFile = Yii::getAlias('@common/helpers/font/DroidSansMono.ttf');
+        $image = imagecreatetruecolor($this->width, $this->height);
+        $backColor = imagecolorallocate(
+            $image,
+            (int)($this->backColor % 0x1000000 / 0x10000),
+            (int)($this->backColor % 0x10000 / 0x100),
+            $this->backColor % 0x100
+        );
+        imagefilledrectangle($image, 0, 0, $this->width - 1, $this->height - 1, $backColor);
+        imagecolordeallocate($image, $backColor);
+        $this->transparent = true;
+        if ($this->transparent) {
+            imagecolortransparent($image, $backColor);
+        }
+
+        $foreColor = imagecolorallocate(
+            $image,
+            (int)($this->foreColor % 0x1000000 / 0x10000),
+            (int)($this->foreColor % 0x10000 / 0x100),
+            $this->foreColor % 0x100
+        );
+
+        $length = strlen($code);
+        $box = imagettfbbox(30, 0, $this->fontFile, $code);
+        $w = $box[4] - $box[0] + $this->offset * ($length - 1);
+        $h = $box[1] - $box[5];
+        $scale = min(($this->width - $this->padding * 2) / $w, ($this->height - $this->padding * 2) / $h);
+        $x = 10;
+        $y = round($this->height * 27 / 40);
+
+        // 添加彩色乱字符
+        $chartDictionary = 'abcdefghjkmnopqrstuvwxyzABCDEFGHJKMNOPQRSTUVWXYZ2345679';
+        for ($i = 0; $i < 50; $i++) {
+            $chartPosition = rand(0, strlen($chartDictionary));
+            $chartContent = substr($chartDictionary, $chartPosition, 1);
+            $chartColor = imagecolorallocate($image, mt_rand(150, 255), mt_rand(150, 255), mt_rand(150, 255));
+            $chartAngle = rand(-10, 10);
+            imagettftext($image, 10, $chartAngle, rand(0, ($this->width - $this->padding * 2) - 10), rand(0, ($this->height - $this->padding * 2) - 10), $chartColor, $this->fontFile, $chartContent);
+        }
+
+        // 设置文字
+        for ($i = 0; $i < $length; ++$i) {
+            $fontSize = (int)(rand(26, 32) * $scale * 0.8);
+            $angle = rand(-10, 10);
+            $letter = $code[$i];
+            $box = imagettftext($image, $fontSize, $angle, $x, $y, $foreColor, $this->fontFile, $letter);
+            $x = $box[2] + $this->offset;
+        }
+
+        // 验证码添加线条
+        for ($i = 0; $i < 10; $i++) {
+            $lineColor = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
+            imageline($image, rand(0, 2), rand(0, ($this->width - $this->height * 2) - 2), rand(0, ($this->width - $this->padding * 2) - 2), rand(0, ($this->width - $this->height * 2) - 2), $lineColor);
+        }
+
+        // 验证码添加噪点
+        for ($i = 0; $i < 300; $i++) {
+            //设置点的颜色
+            $pointColor = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
+            imagesetpixel($image, rand(0, ($this->width - $this->padding * 2)), rand(0, ($this->width - $this->height * 2) - 10), $pointColor);
+        }
+
+        imagecolordeallocate($image, $foreColor);
+
+        ob_start();
+        imagepng($image);
+        imagedestroy($image);
+
+        return ob_get_clean();
+    }
+
+    /**
+     * Runs the action.
+     */
+    public function run()
+    {
+        if (Yii::$app->request->getQueryParam(self::REFRESH_GET_VAR) !== null) {
+            // AJAX request for regenerating code
+            $code = $this->getVerifyCode(true);
+            Yii::$app->response->format = Response::FORMAT_JSON;
+            return [
+                'hash1' => $this->generateValidationHash($code),
+                'hash2' => $this->generateValidationHash(strtolower($code)),
+                // we add a random 'v' parameter so that FireFox can refresh the image
+                // when src attribute of image tag is changed
+                'url' => Url::to([$this->id, 'v' => uniqid()]),
+            ];
+        } else {
+            $this->setHttpHeaders();
+            Yii::$app->response->format = Response::FORMAT_RAW;
+            return $this->renderImage($this->getVerifyCode(true));
+        }
+    }
+
+    /**
+     * @param bool $regenerate
+     * @return int|mixed|string|null
+     */
+    public function getVerifyCode($regenerate = false)
+    {
+        if ($this->fixedVerifyCode !== null) {
+            return $this->fixedVerifyCode;
+        }
+//        $name = $this->getSessionKey();
+        $pageId = \Yii::$app->request->get('page_id');
+        if( !$pageId ) {
+            throw new \Exception('no page id');
+        }
+
+        $cacheRedis = Yii::$app->cache;
+        $key = sprintf(self::CAPTCHA_CODE, $pageId);
+        if( !$regenerate ) {
+            $code = $cacheRedis->get($key);
+            if ( $code ) return $code;
+        }
+
+        $code = $this->generateVerifyCode();
+        $cacheRedis->set($key, $code, 300);
+
+        return $code;
+    }
+
+    public function validate($input, $caseSensitive)
+    {
+        $code = $this->getVerifyCode();
+        $valid = $caseSensitive ? ($input === $code) : strcasecmp($input, $code) === 0;
+        if ( $valid ) {
+            $this->getVerifyCode(true);
+        }
+
+        return $valid;
+    }
 }

+ 124 - 4
common/helpers/bonus/BonusCalc.php

@@ -43,6 +43,7 @@ use common\models\ResendQY;
 use common\models\DeclarationLevel;
 use common\models\DecOrder;
 use common\models\EmployLevel;
+use common\models\FlowBonus;
 use common\models\PerfActiveUser;
 use common\models\ScoreMonth;
 use common\models\User;
@@ -293,6 +294,8 @@ class BonusCalc extends BaseObject {
             //奖金写库
             // 这里增加新的奖金入库操作.
             $this->loopBonusUsers();
+            // 入库完成,将各个奖金计算流水会员聘级,更新成蓝星奖当时计算的聘级
+            $this->loopCalcBlueEmpLv();
             $this->_updatePercent(75);
             unset($calcWrite);
             $t20 = microtime(true);
@@ -1632,7 +1635,17 @@ class BonusCalc extends BaseObject {
                 // 添加到有奖励信息的数据中
                 CalcCache::addHasBonusUsers($user['USER_ID'], $this->_periodNum);
                 //CalcCache::addHasMonthBonusUsers($user['USER_ID'], $this->_periodNum);
-
+                //扣除相应的复消积分和管理费
+                $deductData = $this->deduct($user['USER_ID'], $user['ORI_BONUS']);
+                // 把对碰后的奖金存入缓存中
+                CalcCache::bonus($user['USER_ID'], $this->_periodNum, 'BONUS_BS', $user['ORI_BONUS'], $deductData);
+                $realBonusBs = $deductData['surplus']; // 扣除管理费和复消积分后的实发蓝星奖金
+                $manageTax = $deductData['manageTax']; // 管理费
+                $point = $deductData['reConsumePoints'];// 复消积分
+                // 更新蓝星奖金存储过程的实发金额数据
+                CalcBonusBS::updateAll(['AMOUNT' => $realBonusBs, 'MANAGE_TAX' => $manageTax, 'RECONSUME_POINTS' => $point], 
+                'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
+                [':USER_ID' => $user['USER_ID'], ':PERIOD_NUM' => $this->_periodNum]);
             }
             return $this->calcBonusBsGL($offset + $this->_limit);
         }
@@ -3085,6 +3098,93 @@ class BonusCalc extends BaseObject {
         return true;
     }
 
+    // 奖金入库完成,将各个奖金计算流水会员聘级,更新成蓝星奖当时计算的聘级
+    public function loopCalcBlueEmpLv($offset = 0) {
+        if( !$this->_isCalcMonth ) {
+            // 不是结算月,则不需要进行聘级调整
+            return false;
+        }
+        // 从缓存获取分页有收入的会员信息
+        $allData = CalcBonusBS::findUseDbCalc()
+            ->where('PERIOD_NUM=:PERIOD_NUM', [':PERIOD_NUM' => $this->_periodNum])
+            ->groupBy('USER_ID')
+            ->offset($offset)
+            ->limit($this->_limit)
+            ->asArray()
+            ->all();
+        if ($allData) {
+            foreach ($allData as $data) {
+                $nowBsEmpLv = $data['LEVEL_ID']; // 当前蓝星奖计算(即管理奖) 的等级
+                // 修改AR_CALC_BONUS的LAST_EMP_LV聘级,修改奖金流水的聘级AR_FLOW_BONUS表的LAST_EMP_LV
+                // 期结算结果
+                CalcBonus::updateAll(['LAST_EMP_LV' => $nowBsEmpLv], 'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
+                    [
+                        ':USER_ID' => $data['USER_ID'],
+                        ':PERIOD_NUM' => $this->_periodNum
+                    ]
+                );
+                // 奖金流水
+                FlowBonus::updateAll(['LAST_EMP_LV' => $nowBsEmpLv], 'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
+                    [
+                        ':USER_ID' => $data['USER_ID'],
+                        ':PERIOD_NUM' => $this->_periodNum
+                    ]
+                );
+                // 共享奖流水
+                CalcBonusGX::updateAll(['LAST_EMP_LV' => $nowBsEmpLv], 'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
+                    [
+                        ':USER_ID' => $data['USER_ID'],
+                        ':PERIOD_NUM' => $this->_periodNum
+                    ]
+                );
+                // 推广奖流水
+                CalcBonusTG::updateAll(['LAST_EMP_LV' => $nowBsEmpLv], 'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
+                    [
+                        ':USER_ID' => $data['USER_ID'],
+                        ':PERIOD_NUM' => $this->_periodNum
+                    ]
+                );
+                // 团队奖流水
+                CalcBonusQY::updateAll(['LAST_EMP_LV' => $nowBsEmpLv], 'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
+                    [
+                        ':USER_ID' => $data['USER_ID'],
+                        ':PERIOD_NUM' => $this->_periodNum
+                    ]
+                );
+                // 服务奖流水
+                CalcBonusBD::updateAll(['LAST_EMP_LV' => $nowBsEmpLv], 'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
+                    [
+                        ':USER_ID' => $data['USER_ID'],
+                        ':PERIOD_NUM' => $this->_periodNum
+                    ]
+                );
+                // 更新form的聘级
+                CalcBonusGX::updateAll(['LAST_FROM_EMP_LV' => $nowBsEmpLv], 'FROM_USER_ID=:FROM_USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
+                    [
+                        ':FROM_USER_ID' => $data['USER_ID'],
+                        ':PERIOD_NUM' => $this->_periodNum
+                    ]
+                );
+                CalcBonusTG::updateAll(['LAST_FROM_EMP_LV' => $nowBsEmpLv], 'FROM_USER_ID=:FROM_USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
+                    [
+                        ':FROM_USER_ID' => $data['USER_ID'],
+                        ':PERIOD_NUM' => $this->_periodNum
+                    ]
+                );
+                CalcBonusBD::updateAll(['LAST_FROM_EMP_LV' => $nowBsEmpLv], 'FROM_USER_ID=:FROM_USER_ID AND PERIOD_NUM=:PERIOD_NUM', 
+                    [
+                        ':FROM_USER_ID' => $data['USER_ID'],
+                        ':PERIOD_NUM' => $this->_periodNum
+                    ]
+                );
+            }
+            unset($allData);
+            return $this->loopCalcBlueEmpLv($offset + $this->_limit);
+        }
+        unset($allData);
+        return true;
+    }
+
     /**
      * 奖金
      * @param $userId
@@ -3133,9 +3233,29 @@ class BonusCalc extends BaseObject {
         $buleStartManageTax = 0;
         $exchangePoints = 0; // 蓝星奖管理奖. 产生的兑换积分
         if( $this->_isCalcMonth ) {
-            //查看是否复消300
-            $monthPerfData = CalcCache::nowMonthPerf($userId, $this->_periodNum);
-            $fxPvStatus = $monthPerfData['PV_PCS_FX'] >= $this->_sysConfig['monthPcsPvFxCondition']['VALUE'];
+            // 查看是否复消300
+            // $monthPerfData = CalcCache::nowMonthPerf($userId, $this->_periodNum);
+            // $monthPerf = $monthPerfData['PV_PCS_FX'];
+            // // $fxPvStatus 改成月报单+复消之和是否300
+            // $decPvInfo = PerfPeriod::findUseSlaves()->select('SUM(PV_PCS_ZC) AS ZC_SUM')
+            // ->where('USER_ID=:USER_ID AND CALC_MONTH=:CALC_MONTH', ['USER_ID'=>$userId, 'CALC_MONTH'=>$this->_calcYearMonth])
+            // ->asArray()
+            // ->one(); 
+            // $decPv = isset($decPvInfo['ZC_SUM']) && $decPvInfo['ZC_SUM'] > 0 ?  $decPvInfo['ZC_SUM'] : 0;
+            // $totalCheckPv = $monthPerf + $decPv;
+            // $fxPvStatus = $totalCheckPv >= $this->_sysConfig['monthPcsPvFxCondition']['VALUE'];
+            // 逻辑改成,用户此月累计消费总额大于等于配置,取消订单类型的配置
+            $userMonthTotal = PerfMonth::find()
+            ->where(
+                'USER_ID=:USER_ID AND CALC_MONTH=:CALC_MONTH', 
+                ['USER_ID'=>$userId, 'CALC_MONTH'=>$this->_calcYearMonth]
+            )
+            ->asArray()
+            ->one();
+            $fxPvStatus = false;
+            if (isset($userMonthTotal['PV_PCS']) && $userMonthTotal['PV_PCS'] >= $this->_sysConfig['monthPcsPvFxCondition']['VALUE']) {
+                $fxPvStatus = true;
+            }
             // BONUS_REAL 字段是发到用户的真实奖金
             if ( $fxPvStatus ) {
                 // 管理奖改成了蓝星奖,但是对于用户来说依旧叫管理奖.字段改成bs.

+ 6 - 1
common/helpers/bonus/BonusSend.php

@@ -36,7 +36,12 @@ use yii\base\StaticInstanceTrait;
 use common\helpers\Cache;
 use common\helpers\Date;
 use common\models\CalcBonus;
+use common\models\CalcBonusBD;
 use common\models\CalcBonusBS;
+use common\models\CalcBonusGX;
+use common\models\CalcBonusQY;
+use common\models\CalcBonusTG;
+use common\models\FlowBonus;
 use common\models\PerfActiveUser;
 use common\models\PerfMonth;
 use common\models\User;
@@ -410,9 +415,9 @@ class BonusSend extends BaseObject {
                     foreach ($allData as $data) {
                         //@todo 用户级别不变则不更新
                         if( $data['LEVEL_ID'] === $defaultEmpLv ) continue;
+                        $nowBsEmpLv = $data['LEVEL_ID']; // 当前蓝星奖计算(即管理奖) 的等级
                         $user = CalcCache::getUserInfo($data['USER_ID'], $this->_periodNum);
                         $userEmpLv = $user['EMP_LV']; // 用户的历史最高聘级
-                        $nowBsEmpLv = $data['LEVEL_ID']; // 当前蓝星奖计算(即管理奖) 的等级
                         $userEmpLvSort = $empLv[$userEmpLv]; // 历史最高聘级的 级别值
                         $nowBsEmpLvSort = $empLv[$nowBsEmpLv]; // 当前蓝星计算的聘级 级别值
                         if ($nowBsEmpLvSort > $userEmpLvSort) {

+ 2 - 0
common/helpers/bonus/CalcCache.php

@@ -1429,8 +1429,10 @@ class CalcCache {
             'BONUS_QY' => 0,
             'BONUS_YC' => 0,
             'BONUS_VIP' => 0,
+            'BONUS_BS' => 0,
             'BONUS_YC_EXTRA' => 0,
             'ORI_BONUS_BD' => 0,
+            'ORI_BONUS_BS' => 0,
             'ORI_BONUS_TG' => 0,
             'ORI_BONUS_XF' => 0,
             'ORI_BONUS_YJ' => 0,

+ 0 - 0
common/helpers/bonus/PrepareCalcCache.php


+ 0 - 0
common/helpers/bonus/PreparePerfCalc.php


+ 2 - 0
common/libs/dataList/DataList.php

@@ -114,7 +114,9 @@ class DataList extends Model
      * @throws Exception
      */
     public function getList($params = null){
+
         if($params !== null) {
+
             $this->prepare($params);
         }
         // 获取数据

+ 1 - 1
common/models/BalanceAudit.php

@@ -40,7 +40,7 @@ class BalanceAudit extends \common\components\ActiveRecord
         ],
         'exchange_points' => [
             'name' => 'exchange_points',
-            'label' => '兑换积分',
+            'label' => '兑换点数',
         ],
         'cash' => [
             'name' => 'cash',

+ 290 - 290
common/models/CalcBonus.php

@@ -1,290 +1,290 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_USER_NAME 结算时会员编号
- * @property string $LAST_REAL_NAME 结算时会员姓名
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $LAST_MOBILE 结算时手机号码
- * @property int $LAST_PERIOD_AT 结算时加入期数
- * @property int $LAST_CREATED_AT 结算时加入时间
- * @property string $LAST_SUB_COM_ID 结算时所属分公司
- * @property int $LAST_PROVINCE 结算时所属省份
- * @property int $LAST_CITY 结算时所属城市
- * @property int $LAST_COUNTY 结算时所属地区
- * @property string $LAST_SYSTEM_ID 结算时体系
- * @property int $LAST_IS_DIRECT_SELLER 结算时是否直销员
- * @property string $LAST_REC_USER_NAME 结算时开拓者编号
- * @property string $LAST_REC_REAL_NAME 结算时开拓者姓名
- * @property string $LAST_CON_USER_NAME 结算时上级编号
- * @property string $LAST_CON_REAL_NAME 结算时上级姓名
- * @property int $LAST_LOCATION 结算时市场
- * @property string $BONUS_QY 区域津贴
- * @property string $BONUS_YC 育成津贴
- * @property string $BONUS_VIP VIP奖
- * @property string $BONUS_FX 复销奖
- * @property string $BONUS_LS 零售奖
- * @property string $BONUS_FW 服务奖
- * @property string $BONUS_BT 店补
- * @property string $BONUS_BT_PROD 产品补贴
- * @property string $BONUS_BT_TOOL 工具流补贴
- * @property string $DEDUCT_ZR 责任业绩扣除
- * @property string $BONUS_FL 形象店货补
- * @property string $BONUS_CF 车房养老奖
- * @property string $BONUS_LX 领袖分红
- * @property string $SHOULD_QY 应发区域津贴
- * @property string $SHOULD_DEDUCT_ZR 应扣责任业绩
- * @property string $PV_1L 一市场新增业绩
- * @property string $QY_1L 一市场区域业绩
- * @property string $SURPLUS_1L 一市场结余业绩
- * @property string $PV_2L 二市场新增业绩
- * @property string $QY_2L 二市场区域业绩
- * @property string $SURPLUS_2L 二市场结余业绩
- * @property string $PV_3L 三市场新增业绩
- * @property string $QY_3L 三市场区域业绩
- * @property string $SURPLUS_3L 三市场结余业绩
- * @property string $PV_4L 四市场新增业绩
- * @property string $QY_4L 四市场区域业绩
- * @property string $SURPLUS_4L 四市场结余业绩
- * @property string $PV_5L 五市场新增业绩
- * @property string $QY_5L 五市场区域业绩
- * @property string $SURPLUS_5L 五市场结余业绩
- * @property string $PV_PCS 当期零售
- * @property string $PV_LS_TOUCH 虚拟零售区新增业绩
- * @property string $SURPLUS_LS 虚拟零售区结余
- * @property string $QY_LS 虚拟零售区区域业绩
- * @property string $PV_TOUCH 新增业绩累计
- * @property string $BONUS_REAL 实际奖金
- * @property string $BONUS_TOTAL 总奖金
- * @property string $BONUS_INCOME 总收入
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_YEAR 所在结算年
- * @property int $CALC_MONTH 所在结算月
- * @property int $CALCULATED_AT 结算时间
- * @property int $IS_SENT 是否挂网
- * @property int $SENT_AT 挂网时间
- * @property string $P_CALC_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- *
- * @property string $ORI_BONUS_QY 团队奖原奖金
- * @property string $ORI_BONUS_QY_BD 报单团队奖原奖金
- * @property string $ORI_BONUS_QY_FX 复消团队奖原奖金
- * @property string $ORI_BONUS_YC 荣衔奖奖原奖金
- * @property string $ORI_BONUS_VIP VIP奖奖原奖金
- * @property string $ORI_BONUS_STANDARD 达标奖原奖金
- * @property string $BONUS_BD 服务奖
- * @property string $ORI_BONUS_BD 服务奖原奖金
- * @property string $BONUS_TG 推广奖
- * @property string $ORI_BONUS_TG 推广奖原奖金
- * @property string $BONUS_XF 消费奖
- * @property string $ORI_BONUS_XF 消费奖原奖金
- * @property string $BONUS_YJ 业绩奖
- * @property string $ORI_BONUS_YJ 业绩奖原奖金
- * @property string $ORI_BONUS_YJ_BD 报单业绩奖原奖金
- * @property string $ORI_BONUS_YJ_FX 复消业绩奖原奖金
- * @property string $BONUS_GX 共享奖
- * @property string $ORI_BONUS_GX 共享奖原奖金
- * @property string $BONUS_BONUS_GX 实发共享奖奖金
- * @property string $BONUS_GL 管理奖
- * @property string $ORI_BONUS_GL 管理奖原奖金
- * @property string $BONUS_BONUS_GL 实发管理奖奖金
- * @property string $ORI_BONUS_GL_BD 报单管理奖原奖金
- * @property string $ORI_BONUS_GL_FX 复消管理奖原奖金
- * @property string $RECONSUME_POINTS 复消积分
- * @property string $MANAGE_TAX 管理费 
- * @property string $BONUS_BS 蓝星奖金(即新的管理奖)
- * @property string $ORI_BONUS_BS 蓝星原奖金(即新的管理奖,原奖金)
- */
-class CalcBonus extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'LAST_USER_NAME', 'LAST_REAL_NAME', 'LAST_MOBILE', 'LAST_SYSTEM_ID','LAST_LOCATION', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CALCULATED_AT', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['LAST_STATUS', 'LAST_PERIOD_AT', 'LAST_CREATED_AT', 'LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY', 'LAST_IS_DIRECT_SELLER', 'LAST_LOCATION', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CALCULATED_AT', 'IS_SENT', 'SENT_AT', 'CREATED_AT'], 'integer'],
-            [['ORI_BONUS_BS','EXCHANGE_POINTS','BONUS_BS','BONUS_QY', 'BONUS_YC', 'BONUS_VIP', 'BONUS_FX', 'BONUS_LS', 'BONUS_FW', 'BONUS_BT', 'BONUS_BT_PROD', 'BONUS_BT_TOOL', 'DEDUCT_ZR', 'BONUS_FL', 'BONUS_CF', 'BONUS_LX', 'SHOULD_QY', 'SHOULD_DEDUCT_ZR', 'PV_1L', 'QY_1L', 'SURPLUS_1L', 'PV_2L', 'QY_2L', 'SURPLUS_2L', 'PV_3L', 'QY_3L', 'SURPLUS_3L', 'PV_4L', 'QY_4L', 'SURPLUS_4L', 'PV_5L', 'QY_5L', 'SURPLUS_5L', 'PV_PCS', 'PV_LS_TOUCH', 'SURPLUS_LS', 'QY_LS', 'PV_TOUCH', 'BONUS_REAL', 'BONUS_TOTAL', 'BONUS_INCOME', 'ORI_BONUS_QY','ORI_BONUS_QY_BD','ORI_BONUS_QY_FX','ORI_BONUS_YC', 'ORI_BONUS_VIP','ORI_BONUS_STANDARD','BONUS_BD','ORI_BONUS_BD','BONUS_TG','ORI_BONUS_TG','BONUS_XF','ORI_BONUS_XF','BONUS_YJ','ORI_BONUS_YJ','ORI_BONUS_YJ_BD','ORI_BONUS_YJ_FX','BONUS_GX','ORI_BONUS_GX','REAL_BONUS_GX','BONUS_GL','ORI_BONUS_GL','REAL_BONUS_GL','ORI_BONUS_GL_BD','ORI_BONUS_GL_FX','RECONSUME_POINTS','MANAGE_TAX'], 'number'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'LAST_SUB_COM_ID', 'LAST_SYSTEM_ID'], 'string', 'max' => 32],
-            [['LAST_USER_NAME', 'LAST_REC_USER_NAME', 'LAST_CON_USER_NAME'], 'string', 'max' => 16],
-            [['LAST_REAL_NAME', 'LAST_REC_REAL_NAME', 'LAST_CON_REAL_NAME'], 'string', 'max' => 128],
-            [['LAST_MOBILE'], 'string', 'max' => 11],
-            [['P_CALC_MONTH'], 'safe'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_USER_NAME' => '结算时会员编号',
-            'LAST_REAL_NAME' => '结算时会员姓名',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'LAST_MOBILE' => '结算时手机号码',
-            'LAST_PERIOD_AT' => '结算时加入期数',
-            'LAST_CREATED_AT' => '结算时加入时间',
-            'LAST_SUB_COM_ID' => '结算时所属分公司',
-            'LAST_PROVINCE' => '结算时所属省份',
-            'LAST_CITY' => '结算时所属城市',
-            'LAST_COUNTY' => '结算时所属地区',
-            'LAST_SYSTEM_ID' => '结算时体系',
-            'LAST_IS_DIRECT_SELLER' => '结算时是否直销员',
-            'LAST_REC_USER_NAME' => '结算时开拓者编号',
-            'LAST_REC_REAL_NAME' => '结算时开拓者姓名',
-            'LAST_CON_USER_NAME' => '结算时上级编号',
-            'LAST_CON_REAL_NAME' => '结算时上级姓名',
-            'LAST_LOCATION' => '结算时市场',
-            'BONUS_QY' => '区域津贴',
-            'BONUS_YC' => '荣衔奖',
-            'BONUS_VIP' => 'VIP奖',
-            'BONUS_FX' => '复销奖',
-            'BONUS_LS' => '零售奖',
-            'BONUS_FW' => '服务奖',
-            'BONUS_BT' => '店补',
-            'BONUS_BT_PROD' => '产品补贴',
-            'BONUS_BT_TOOL' => '工具流补贴',
-            'DEDUCT_ZR' => '责任业绩扣除',
-            'BONUS_FL' => '形象店货补',
-            'BONUS_CF' => '车房养老奖',
-            'BONUS_LX' => '领袖分红',
-            'SHOULD_QY' => '应发区域津贴',
-            'SHOULD_DEDUCT_ZR' => '应扣责任业绩',
-            'PV_1L' => '一市场新增业绩',
-            'QY_1L' => '一市场区域业绩',
-            'SURPLUS_1L' => '一市场结余业绩',
-            'PV_2L' => '二市场新增业绩',
-            'QY_2L' => '二市场区域业绩',
-            'SURPLUS_2L' => '二市场结余业绩',
-            'PV_3L' => '三市场新增业绩',
-            'QY_3L' => '三市场区域业绩',
-            'SURPLUS_3L' => '三市场结余业绩',
-            'PV_4L' => '四市场新增业绩',
-            'QY_4L' => '四市场区域业绩',
-            'SURPLUS_4L' => '四市场结余业绩',
-            'PV_5L' => '五市场新增业绩',
-            'QY_5L' => '五市场区域业绩',
-            'SURPLUS_5L' => '五市场结余业绩',
-            'PV_PCS' => '当期零售',
-            'PV_LS_TOUCH' => '虚拟零售区新增业绩',
-            'SURPLUS_LS' => '虚拟零售区结余',
-            'QY_LS' => '虚拟零售区区域业绩',
-            'PV_TOUCH' => '新增业绩累计',
-            'BONUS_REAL' => '实际奖金',
-            'BONUS_TOTAL' => '总奖金',
-            'BONUS_INCOME' => '总收入',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_YEAR' => '所在结算年',
-            'CALC_MONTH' => '所在结算月',
-            'CALCULATED_AT' => '结算时间',
-            'IS_SENT' => '是否挂网',
-            'SENT_AT' => '挂网时间',
-            'P_CALC_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'ORI_BONUS_QY'=> '团队奖原奖金',
-            'ORI_BONUS_QY_BD'=> '报单团队奖原奖金',
-            'ORI_BONUS_QY_FX'=> '复消团队奖原奖金',
-            'ORI_BONUS_YC'=> '荣衔奖原奖金',
-            'ORI_BONUS_VIP'=> 'VIP奖原奖金',
-            'ORI_BONUS_STANDARD'=> '达标奖原奖金',
-            'BONUS_BD'=> '服务奖',
-            'ORI_BONUS_BD'=> '服务奖原奖金',
-            'BONUS_TG'=> '推广奖',
-            'ORI_BONUS_TG'=> '推广奖原奖金',
-            'BONUS_XF'=> '消费奖',
-            'ORI_BONUS_XF'=> '消费奖原奖金',
-            'BONUS_YJ'=> '业绩奖',
-            'ORI_BONUS_YJ'=> '业绩奖原奖金',
-            'ORI_BONUS_YJ_BD'=> '报单业绩奖原奖金',
-            'ORI_BONUS_YJ_FX'=> '复消业绩奖原奖金',
-            'BONUS_GX'=> '共享奖',
-            'ORI_BONUS_GX'=> '共享奖原奖金',
-            'REAL_BONUS_GX'=> '实发共享奖奖金',
-            'BONUS_GL'=> '管理奖',
-            'ORI_BONUS_GL'=> '管理奖原奖金',
-            'REAL_BONUS_GL'=> '实发管理奖奖金',
-            'ORI_BONUS_GL_BD'=> '报单管理奖原奖金',
-            'ORI_BONUS_GL_FX'=> '复消管理奖原奖金',
-            'RECONSUME_POINTS'=> '复消积分',
-            'MANAGE_TAX'=> '管理费',
-            'EXCHANGE_POINTS' => '兑换积分',
-            'BONUS_BS' => '蓝星奖',
-            'ORI_BONUS_BS' => '蓝星原奖金'
-        ];
-    }
-
-    /**
-     * 近几期的奖金
-     * @param $userId
-     * @param int $num
-     * @return array
-     * @throws \yii\db\Exception
-     */
-    public static function periodBonus($userId, $num = 7){
-        // 获取近几期的年月
-        $periodYearMonths = Period::getNearlyPeriodYearMonth($num);
-        $allBonus = [];
-        foreach($periodYearMonths as $data){
-            $allBonus[] = static::findUseSlaves()->yearMonth($data['yearMonth'])->select('USER_ID,BONUS_QY, BONUS_YC, BONUS_FX, BONUS_LS, BONUS_FW, BONUS_BT, BONUS_BT_PROD, BONUS_BT_TOOL, DEDUCT_ZR, BONUS_FL, BONUS_CF, BONUS_LX, SHOULD_QY')->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM AND IS_SENT=1', [':USER_ID'=>$userId, ':PERIOD_NUM'=>$data['periodNum']])->asArray()->one();
-        }
-        return $allBonus;
-    }
-
-    /**
-     * 获取期数对应的奖金情况
-     * @param $userId
-     * @param $periodNum
-     * @return array|null|\yii\db\ActiveRecord
-     * @throws \yii\db\Exception
-     */
-    public static function periodNumBonus($userId, $periodNum){
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-        return static::findUseSlaves()->yearMonth($yearMonth)->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', [':USER_ID'=>$userId, ':PERIOD_NUM'=>$periodNum])->select('USER_ID,BONUS_QY, BONUS_YC, BONUS_TG, BONUS_YJ, BONUS_GX, BONUS_GL, ORI_BONUS_QY, ORI_BONUS_YC, ORI_BONUS_TG, ORI_BONUS_YJ, ORI_BONUS_GX, ORI_BONUS_GL, RECONSUME_POINTS, MANAGE_TAX, BONUS_REAL, BONUS_TOTAL, BONUS_INCOME')->asArray()->one();
-    }
-
-    /**
-     * 根据期数获取月累计奖金
-     * @param $userId
-     * @param $periodNum
-     * @param string $type
-     * @return int|mixed
-     * @throws \yii\db\Exception
-     */
-    public static function monthBonus($userId, $periodNum=null, $type = 'BONUS_QY') {
-        if($periodNum) {
-            $period = Period::instance();
-            $yearMonth = $period->getYearMonth($periodNum);
-            if ($yearMonth) {
-                $bonus = CalcBonus::findUseSlaves()->yearMonth($yearMonth)->select('SUM(' . $type . ') AS ' . $type . '_SUM')->where('USER_ID=:USER_ID AND CALC_MONTH=:CALC_MONTH AND IS_SENT=1', [':USER_ID' => $userId, ':CALC_MONTH' => $yearMonth])->asArray()->one();
-            }
-        }else{
-            $bonus = CalcBonus::findUseSlaves()->select('SUM(' . $type . ') AS ' . $type . '_SUM')->where('USER_ID=:USER_ID AND IS_SENT=1', [':USER_ID' => $userId])->asArray()->one();
-        }
-        return $bonus[$type . '_SUM'] ?? 0;
-    }
-}
+<?php
+
+namespace common\models;
+
+use Yii;
+
+/**
+ * This is the model class for table "{{%CALC_BONUS}}".
+ *
+ * @property string $ID
+ * @property string $USER_ID 会员ID
+ * @property string $LAST_USER_NAME 结算时会员编号
+ * @property string $LAST_REAL_NAME 结算时会员姓名
+ * @property string $LAST_DEC_LV 结算时会员级别
+ * @property string $LAST_EMP_LV 结算时会员聘级
+ * @property int $LAST_STATUS 结算时状态
+ * @property string $LAST_MOBILE 结算时手机号码
+ * @property int $LAST_PERIOD_AT 结算时加入期数
+ * @property int $LAST_CREATED_AT 结算时加入时间
+ * @property string $LAST_SUB_COM_ID 结算时所属分公司
+ * @property int $LAST_PROVINCE 结算时所属省份
+ * @property int $LAST_CITY 结算时所属城市
+ * @property int $LAST_COUNTY 结算时所属地区
+ * @property string $LAST_SYSTEM_ID 结算时体系
+ * @property int $LAST_IS_DIRECT_SELLER 结算时是否直销员
+ * @property string $LAST_REC_USER_NAME 结算时开拓者编号
+ * @property string $LAST_REC_REAL_NAME 结算时开拓者姓名
+ * @property string $LAST_CON_USER_NAME 结算时上级编号
+ * @property string $LAST_CON_REAL_NAME 结算时上级姓名
+ * @property int $LAST_LOCATION 结算时市场
+ * @property string $BONUS_QY 区域津贴
+ * @property string $BONUS_YC 育成津贴
+ * @property string $BONUS_VIP VIP奖
+ * @property string $BONUS_FX 复销奖
+ * @property string $BONUS_LS 零售奖
+ * @property string $BONUS_FW 服务奖
+ * @property string $BONUS_BT 店补
+ * @property string $BONUS_BT_PROD 产品补贴
+ * @property string $BONUS_BT_TOOL 工具流补贴
+ * @property string $DEDUCT_ZR 责任业绩扣除
+ * @property string $BONUS_FL 形象店货补
+ * @property string $BONUS_CF 车房养老奖
+ * @property string $BONUS_LX 领袖分红
+ * @property string $SHOULD_QY 应发区域津贴
+ * @property string $SHOULD_DEDUCT_ZR 应扣责任业绩
+ * @property string $PV_1L 一市场新增业绩
+ * @property string $QY_1L 一市场区域业绩
+ * @property string $SURPLUS_1L 一市场结余业绩
+ * @property string $PV_2L 二市场新增业绩
+ * @property string $QY_2L 二市场区域业绩
+ * @property string $SURPLUS_2L 二市场结余业绩
+ * @property string $PV_3L 三市场新增业绩
+ * @property string $QY_3L 三市场区域业绩
+ * @property string $SURPLUS_3L 三市场结余业绩
+ * @property string $PV_4L 四市场新增业绩
+ * @property string $QY_4L 四市场区域业绩
+ * @property string $SURPLUS_4L 四市场结余业绩
+ * @property string $PV_5L 五市场新增业绩
+ * @property string $QY_5L 五市场区域业绩
+ * @property string $SURPLUS_5L 五市场结余业绩
+ * @property string $PV_PCS 当期零售
+ * @property string $PV_LS_TOUCH 虚拟零售区新增业绩
+ * @property string $SURPLUS_LS 虚拟零售区结余
+ * @property string $QY_LS 虚拟零售区区域业绩
+ * @property string $PV_TOUCH 新增业绩累计
+ * @property string $BONUS_REAL 实际奖金
+ * @property string $BONUS_TOTAL 总奖金
+ * @property string $BONUS_INCOME 总收入
+ * @property int $PERIOD_NUM 结算期数
+ * @property int $CALC_YEAR 所在结算年
+ * @property int $CALC_MONTH 所在结算月
+ * @property int $CALCULATED_AT 结算时间
+ * @property int $IS_SENT 是否挂网
+ * @property int $SENT_AT 挂网时间
+ * @property string $P_CALC_MONTH 表分区的日期索引
+ * @property int $CREATED_AT 创建时间
+ *
+ * @property string $ORI_BONUS_QY 团队奖原奖金
+ * @property string $ORI_BONUS_QY_BD 报单团队奖原奖金
+ * @property string $ORI_BONUS_QY_FX 复消团队奖原奖金
+ * @property string $ORI_BONUS_YC 荣衔奖奖原奖金
+ * @property string $ORI_BONUS_VIP VIP奖奖原奖金
+ * @property string $ORI_BONUS_STANDARD 达标奖原奖金
+ * @property string $BONUS_BD 服务奖
+ * @property string $ORI_BONUS_BD 服务奖原奖金
+ * @property string $BONUS_TG 推广奖
+ * @property string $ORI_BONUS_TG 推广奖原奖金
+ * @property string $BONUS_XF 消费奖
+ * @property string $ORI_BONUS_XF 消费奖原奖金
+ * @property string $BONUS_YJ 业绩奖
+ * @property string $ORI_BONUS_YJ 业绩奖原奖金
+ * @property string $ORI_BONUS_YJ_BD 报单业绩奖原奖金
+ * @property string $ORI_BONUS_YJ_FX 复消业绩奖原奖金
+ * @property string $BONUS_GX 共享奖
+ * @property string $ORI_BONUS_GX 共享奖原奖金
+ * @property string $BONUS_BONUS_GX 实发共享奖奖金
+ * @property string $BONUS_GL 管理奖
+ * @property string $ORI_BONUS_GL 管理奖原奖金
+ * @property string $BONUS_BONUS_GL 实发管理奖奖金
+ * @property string $ORI_BONUS_GL_BD 报单管理奖原奖金
+ * @property string $ORI_BONUS_GL_FX 复消管理奖原奖金
+ * @property string $RECONSUME_POINTS 复消积分
+ * @property string $MANAGE_TAX 管理费 
+ * @property string $BONUS_BS 蓝星奖金(即新的管理奖)
+ * @property string $ORI_BONUS_BS 蓝星原奖金(即新的管理奖,原奖金)
+ */
+class CalcBonus extends \common\components\ActiveRecord
+{
+    /**
+     * {@inheritdoc}
+     */
+    public static function tableName()
+    {
+        return '{{%CALC_BONUS}}';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function rules()
+    {
+        return [
+            [['USER_ID', 'LAST_USER_NAME', 'LAST_REAL_NAME', 'LAST_MOBILE', 'LAST_SYSTEM_ID','LAST_LOCATION', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CALCULATED_AT', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
+            [['LAST_STATUS', 'LAST_PERIOD_AT', 'LAST_CREATED_AT', 'LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY', 'LAST_IS_DIRECT_SELLER', 'LAST_LOCATION', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CALCULATED_AT', 'IS_SENT', 'SENT_AT', 'CREATED_AT'], 'integer'],
+            [['ORI_BONUS_BS','EXCHANGE_POINTS','BONUS_BS','BONUS_QY', 'BONUS_YC', 'BONUS_VIP', 'BONUS_FX', 'BONUS_LS', 'BONUS_FW', 'BONUS_BT', 'BONUS_BT_PROD', 'BONUS_BT_TOOL', 'DEDUCT_ZR', 'BONUS_FL', 'BONUS_CF', 'BONUS_LX', 'SHOULD_QY', 'SHOULD_DEDUCT_ZR', 'PV_1L', 'QY_1L', 'SURPLUS_1L', 'PV_2L', 'QY_2L', 'SURPLUS_2L', 'PV_3L', 'QY_3L', 'SURPLUS_3L', 'PV_4L', 'QY_4L', 'SURPLUS_4L', 'PV_5L', 'QY_5L', 'SURPLUS_5L', 'PV_PCS', 'PV_LS_TOUCH', 'SURPLUS_LS', 'QY_LS', 'PV_TOUCH', 'BONUS_REAL', 'BONUS_TOTAL', 'BONUS_INCOME', 'ORI_BONUS_QY','ORI_BONUS_QY_BD','ORI_BONUS_QY_FX','ORI_BONUS_YC', 'ORI_BONUS_VIP','ORI_BONUS_STANDARD','BONUS_BD','ORI_BONUS_BD','BONUS_TG','ORI_BONUS_TG','BONUS_XF','ORI_BONUS_XF','BONUS_YJ','ORI_BONUS_YJ','ORI_BONUS_YJ_BD','ORI_BONUS_YJ_FX','BONUS_GX','ORI_BONUS_GX','REAL_BONUS_GX','BONUS_GL','ORI_BONUS_GL','REAL_BONUS_GL','ORI_BONUS_GL_BD','ORI_BONUS_GL_FX','RECONSUME_POINTS','MANAGE_TAX'], 'number'],
+            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'LAST_SUB_COM_ID', 'LAST_SYSTEM_ID'], 'string', 'max' => 32],
+            [['LAST_USER_NAME', 'LAST_REC_USER_NAME', 'LAST_CON_USER_NAME'], 'string', 'max' => 16],
+            [['LAST_REAL_NAME', 'LAST_REC_REAL_NAME', 'LAST_CON_REAL_NAME'], 'string', 'max' => 128],
+            [['LAST_MOBILE'], 'string', 'max' => 11],
+            [['P_CALC_MONTH'], 'safe'],
+            [['ID'], 'unique'],
+        ];
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function attributeLabels()
+    {
+        return [
+            'ID' => 'ID',
+            'USER_ID' => '会员ID',
+            'LAST_USER_NAME' => '结算时会员编号',
+            'LAST_REAL_NAME' => '结算时会员姓名',
+            'LAST_DEC_LV' => '结算时会员级别',
+            'LAST_EMP_LV' => '结算时会员聘级',
+            'LAST_STATUS' => '结算时状态',
+            'LAST_MOBILE' => '结算时手机号码',
+            'LAST_PERIOD_AT' => '结算时加入期数',
+            'LAST_CREATED_AT' => '结算时加入时间',
+            'LAST_SUB_COM_ID' => '结算时所属分公司',
+            'LAST_PROVINCE' => '结算时所属省份',
+            'LAST_CITY' => '结算时所属城市',
+            'LAST_COUNTY' => '结算时所属地区',
+            'LAST_SYSTEM_ID' => '结算时体系',
+            'LAST_IS_DIRECT_SELLER' => '结算时是否直销员',
+            'LAST_REC_USER_NAME' => '结算时开拓者编号',
+            'LAST_REC_REAL_NAME' => '结算时开拓者姓名',
+            'LAST_CON_USER_NAME' => '结算时上级编号',
+            'LAST_CON_REAL_NAME' => '结算时上级姓名',
+            'LAST_LOCATION' => '结算时市场',
+            'BONUS_QY' => '区域津贴',
+            'BONUS_YC' => '荣衔奖',
+            'BONUS_VIP' => 'VIP奖',
+            'BONUS_FX' => '复销奖',
+            'BONUS_LS' => '零售奖',
+            'BONUS_FW' => '服务奖',
+            'BONUS_BT' => '店补',
+            'BONUS_BT_PROD' => '产品补贴',
+            'BONUS_BT_TOOL' => '工具流补贴',
+            'DEDUCT_ZR' => '责任业绩扣除',
+            'BONUS_FL' => '形象店货补',
+            'BONUS_CF' => '车房养老奖',
+            'BONUS_LX' => '领袖分红',
+            'SHOULD_QY' => '应发区域津贴',
+            'SHOULD_DEDUCT_ZR' => '应扣责任业绩',
+            'PV_1L' => '一市场新增业绩',
+            'QY_1L' => '一市场区域业绩',
+            'SURPLUS_1L' => '一市场结余业绩',
+            'PV_2L' => '二市场新增业绩',
+            'QY_2L' => '二市场区域业绩',
+            'SURPLUS_2L' => '二市场结余业绩',
+            'PV_3L' => '三市场新增业绩',
+            'QY_3L' => '三市场区域业绩',
+            'SURPLUS_3L' => '三市场结余业绩',
+            'PV_4L' => '四市场新增业绩',
+            'QY_4L' => '四市场区域业绩',
+            'SURPLUS_4L' => '四市场结余业绩',
+            'PV_5L' => '五市场新增业绩',
+            'QY_5L' => '五市场区域业绩',
+            'SURPLUS_5L' => '五市场结余业绩',
+            'PV_PCS' => '当期零售',
+            'PV_LS_TOUCH' => '虚拟零售区新增业绩',
+            'SURPLUS_LS' => '虚拟零售区结余',
+            'QY_LS' => '虚拟零售区区域业绩',
+            'PV_TOUCH' => '新增业绩累计',
+            'BONUS_REAL' => '实际奖金',
+            'BONUS_TOTAL' => '总奖金',
+            'BONUS_INCOME' => '总收入',
+            'PERIOD_NUM' => '结算期数',
+            'CALC_YEAR' => '所在结算年',
+            'CALC_MONTH' => '所在结算月',
+            'CALCULATED_AT' => '结算时间',
+            'IS_SENT' => '是否挂网',
+            'SENT_AT' => '挂网时间',
+            'P_CALC_MONTH' => '表分区的日期索引',
+            'CREATED_AT' => '创建时间',
+            'ORI_BONUS_QY'=> '团队奖原奖金',
+            'ORI_BONUS_QY_BD'=> '报单团队奖原奖金',
+            'ORI_BONUS_QY_FX'=> '复消团队奖原奖金',
+            'ORI_BONUS_YC'=> '荣衔奖原奖金',
+            'ORI_BONUS_VIP'=> 'VIP奖原奖金',
+            'ORI_BONUS_STANDARD'=> '达标奖原奖金',
+            'BONUS_BD'=> '服务奖',
+            'ORI_BONUS_BD'=> '服务奖原奖金',
+            'BONUS_TG'=> '推广奖',
+            'ORI_BONUS_TG'=> '推广奖原奖金',
+            'BONUS_XF'=> '消费奖',
+            'ORI_BONUS_XF'=> '消费奖原奖金',
+            'BONUS_YJ'=> '业绩奖',
+            'ORI_BONUS_YJ'=> '业绩奖原奖金',
+            'ORI_BONUS_YJ_BD'=> '报单业绩奖原奖金',
+            'ORI_BONUS_YJ_FX'=> '复消业绩奖原奖金',
+            'BONUS_GX'=> '共享奖',
+            'ORI_BONUS_GX'=> '共享奖原奖金',
+            'REAL_BONUS_GX'=> '实发共享奖奖金',
+            'BONUS_GL'=> '管理奖',
+            'ORI_BONUS_GL'=> '管理奖原奖金',
+            'REAL_BONUS_GL'=> '实发管理奖奖金',
+            'ORI_BONUS_GL_BD'=> '报单管理奖原奖金',
+            'ORI_BONUS_GL_FX'=> '复消管理奖原奖金',
+            'RECONSUME_POINTS'=> '复消积分',
+            'MANAGE_TAX'=> '管理费',
+            'EXCHANGE_POINTS' => '兑换点数',
+            'BONUS_BS' => '蓝星奖',
+            'ORI_BONUS_BS' => '蓝星原奖金'
+        ];
+    }
+
+    /**
+     * 近几期的奖金
+     * @param $userId
+     * @param int $num
+     * @return array
+     * @throws \yii\db\Exception
+     */
+    public static function periodBonus($userId, $num = 7){
+        // 获取近几期的年月
+        $periodYearMonths = Period::getNearlyPeriodYearMonth($num);
+        $allBonus = [];
+        foreach($periodYearMonths as $data){
+            $allBonus[] = static::findUseSlaves()->yearMonth($data['yearMonth'])->select('USER_ID,BONUS_QY, BONUS_YC, BONUS_FX, BONUS_LS, BONUS_FW, BONUS_BT, BONUS_BT_PROD, BONUS_BT_TOOL, DEDUCT_ZR, BONUS_FL, BONUS_CF, BONUS_LX, SHOULD_QY')->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM AND IS_SENT=1', [':USER_ID'=>$userId, ':PERIOD_NUM'=>$data['periodNum']])->asArray()->one();
+        }
+        return $allBonus;
+    }
+
+    /**
+     * 获取期数对应的奖金情况
+     * @param $userId
+     * @param $periodNum
+     * @return array|null|\yii\db\ActiveRecord
+     * @throws \yii\db\Exception
+     */
+    public static function periodNumBonus($userId, $periodNum){
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+        return static::findUseSlaves()->yearMonth($yearMonth)->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', [':USER_ID'=>$userId, ':PERIOD_NUM'=>$periodNum])->select('USER_ID,BONUS_QY, BONUS_YC, BONUS_TG, BONUS_YJ, BONUS_GX, BONUS_GL, ORI_BONUS_QY, ORI_BONUS_YC, ORI_BONUS_TG, ORI_BONUS_YJ, ORI_BONUS_GX, ORI_BONUS_GL, RECONSUME_POINTS, MANAGE_TAX, BONUS_REAL, BONUS_TOTAL, BONUS_INCOME')->asArray()->one();
+    }
+
+    /**
+     * 根据期数获取月累计奖金
+     * @param $userId
+     * @param $periodNum
+     * @param string $type
+     * @return int|mixed
+     * @throws \yii\db\Exception
+     */
+    public static function monthBonus($userId, $periodNum=null, $type = 'BONUS_QY') {
+        if($periodNum) {
+            $period = Period::instance();
+            $yearMonth = $period->getYearMonth($periodNum);
+            if ($yearMonth) {
+                $bonus = CalcBonus::findUseSlaves()->yearMonth($yearMonth)->select('SUM(' . $type . ') AS ' . $type . '_SUM')->where('USER_ID=:USER_ID AND CALC_MONTH=:CALC_MONTH AND IS_SENT=1', [':USER_ID' => $userId, ':CALC_MONTH' => $yearMonth])->asArray()->one();
+            }
+        }else{
+            $bonus = CalcBonus::findUseSlaves()->select('SUM(' . $type . ') AS ' . $type . '_SUM')->where('USER_ID=:USER_ID AND IS_SENT=1', [':USER_ID' => $userId])->asArray()->one();
+        }
+        return $bonus[$type . '_SUM'] ?? 0;
+    }
+}

+ 69 - 69
common/models/OrderGoods.php

@@ -1,69 +1,69 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER_GOODS}}".
- *
- * @property string $ID
- * @property string $ORDER_SN 订单ID
- * @property string $GOODS_ID 商品ID
- * @property string $GOODS_TITLE 商品名称
- * @property string $PRICE 价格
- * @property string $REAL_PRICE 实际价格
- * @property string $PV 订货PV
- * @property string $REAL_PV 实际PV
- * @property string $POINT 兑换积分
- * @property string $SKU_CODE 商品编码
- * @property int $BUY_NUMS 购买数量
- * @property string $P_CALC_MONTH 分区日期
- */
-class OrderGoods extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER_GOODS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ORDER_SN', 'GOODS_ID', 'GOODS_TITLE', 'SKU_CODE'], 'required'],
-            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT'], 'number'],
-            [['BUY_NUMS'], 'integer'],
-            [['ID', 'ORDER_SN', 'GOODS_ID'], 'string', 'max' => 32],
-            [['GOODS_TITLE'], 'string', 'max' => 255],
-            [['SKU_CODE'], 'string', 'max' => 16],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'ORDER_SN' => '订单ID',
-            'GOODS_ID' => '商品ID',
-            'GOODS_TITLE' => '商品名称',
-            'PRICE' => '价格',
-            'REAL_PRICE' => '实际价格',
-            'PV' => '订货PV',
-            'REAL_PV' => '实际PV',
-            'POINT' => '兑换积分',
-            'SKU_CODE' => '商品编码',
-            'BUY_NUMS' => '购买数量',
-            'P_CALC_MONTH' => '分区日期',
-        ];
-    }
-}
+<?php
+
+namespace common\models;
+
+use Yii;
+
+/**
+ * This is the model class for table "{{%ORDER_GOODS}}".
+ *
+ * @property string $ID
+ * @property string $ORDER_SN 订单ID
+ * @property string $GOODS_ID 商品ID
+ * @property string $GOODS_TITLE 商品名称
+ * @property string $PRICE 价格
+ * @property string $REAL_PRICE 实际价格
+ * @property string $PV 订货PV
+ * @property string $REAL_PV 实际PV
+ * @property string $POINT 兑换点数
+ * @property string $SKU_CODE 商品编码
+ * @property int $BUY_NUMS 购买数量
+ * @property string $P_CALC_MONTH 分区日期
+ */
+class OrderGoods extends \common\components\ActiveRecord
+{
+    /**
+     * {@inheritdoc}
+     */
+    public static function tableName()
+    {
+        return '{{%ORDER_GOODS}}';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function rules()
+    {
+        return [
+            [['ORDER_SN', 'GOODS_ID', 'GOODS_TITLE', 'SKU_CODE'], 'required'],
+            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT'], 'number'],
+            [['BUY_NUMS'], 'integer'],
+            [['ID', 'ORDER_SN', 'GOODS_ID'], 'string', 'max' => 32],
+            [['GOODS_TITLE'], 'string', 'max' => 255],
+            [['SKU_CODE'], 'string', 'max' => 16],
+            [['ID'], 'unique'],
+        ];
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function attributeLabels()
+    {
+        return [
+            'ID' => 'ID',
+            'ORDER_SN' => '订单ID',
+            'GOODS_ID' => '商品ID',
+            'GOODS_TITLE' => '商品名称',
+            'PRICE' => '价格',
+            'REAL_PRICE' => '实际价格',
+            'PV' => '订货PV',
+            'REAL_PV' => '实际PV',
+            'POINT' => '兑换点数',
+            'SKU_CODE' => '商品编码',
+            'BUY_NUMS' => '购买数量',
+            'P_CALC_MONTH' => '分区日期',
+        ];
+    }
+}

+ 71 - 71
common/models/OrderGoodsDec.php

@@ -1,71 +1,71 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER_GOODS_DEC}}".
- *
- * @property string $ID
- * @property string $ORDER_SN 订单ID
- * @property string $GOODS_TITLE 商品名称
- * @property string $PRICE 价格
- * @property string $REAL_PRICE 实际价格
- * @property string $PV 订货PV
- * @property string $REAL_PV 实际PV
- * @property string $POINT 兑换积分
- * @property int $PERIOD_NUM 期数
- * @property int $ORDER_DAY 日期
- * @property string $SKU_CODE 商品编码
- * @property int $BUY_NUMS 购买数量
- * @property string $P_CALC_MONTH 分区日期
- */
-class OrderGoodsDec extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER_GOODS_DEC}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ORDER_SN', 'GOODS_TITLE', 'SKU_CODE'], 'required'],
-            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT'], 'number'],
-            [['BUY_NUMS', 'PERIOD_NUM'], 'integer'],
-            [['ID', 'ORDER_SN'], 'string', 'max' => 32],
-            [['GOODS_TITLE'], 'string', 'max' => 255],
-            [['SKU_CODE','ORDER_DAY'], 'string', 'max' => 16],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'ORDER_SN' => '订单ID',
-            'GOODS_TITLE' => '商品名称',
-            'PRICE' => '价格',
-            'REAL_PRICE' => '实际价格',
-            'PV' => '订货PV',
-            'REAL_PV' => '实际PV',
-            'POINT' => '兑换积分',
-            'PERIOD_NUM' => '期数',
-            'ORDER_DAY' => '日期',
-            'SKU_CODE' => '商品编码',
-            'BUY_NUMS' => '购买数量',
-            'P_CALC_MONTH' => '分区日期',
-        ];
-    }
-}
+<?php
+
+namespace common\models;
+
+use Yii;
+
+/**
+ * This is the model class for table "{{%ORDER_GOODS_DEC}}".
+ *
+ * @property string $ID
+ * @property string $ORDER_SN 订单ID
+ * @property string $GOODS_TITLE 商品名称
+ * @property string $PRICE 价格
+ * @property string $REAL_PRICE 实际价格
+ * @property string $PV 订货PV
+ * @property string $REAL_PV 实际PV
+ * @property string $POINT 兑换积分
+ * @property int $PERIOD_NUM 期数
+ * @property int $ORDER_DAY 日期
+ * @property string $SKU_CODE 商品编码
+ * @property int $BUY_NUMS 购买数量
+ * @property string $P_CALC_MONTH 分区日期
+ */
+class OrderGoodsDec extends \common\components\ActiveRecord
+{
+    /**
+     * {@inheritdoc}
+     */
+    public static function tableName()
+    {
+        return '{{%ORDER_GOODS_DEC}}';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function rules()
+    {
+        return [
+            [['ORDER_SN', 'GOODS_TITLE', 'SKU_CODE'], 'required'],
+            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT'], 'number'],
+            [['BUY_NUMS', 'PERIOD_NUM'], 'integer'],
+            [['ID', 'ORDER_SN'], 'string', 'max' => 32],
+            [['GOODS_TITLE'], 'string', 'max' => 255],
+            [['SKU_CODE','ORDER_DAY'], 'string', 'max' => 16],
+            [['ID'], 'unique'],
+        ];
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function attributeLabels()
+    {
+        return [
+            'ID' => 'ID',
+            'ORDER_SN' => '订单ID',
+            'GOODS_TITLE' => '商品名称',
+            'PRICE' => '价格',
+            'REAL_PRICE' => '实际价格',
+            'PV' => '订货PV',
+            'REAL_PV' => '实际PV',
+            'POINT' => '兑换点数',
+            'PERIOD_NUM' => '期数',
+            'ORDER_DAY' => '日期',
+            'SKU_CODE' => '商品编码',
+            'BUY_NUMS' => '购买数量',
+            'P_CALC_MONTH' => '分区日期',
+        ];
+    }
+}

+ 69 - 69
common/models/OrderGoodsShop.php

@@ -1,69 +1,69 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER_GOODS}}".
- *
- * @property string $ID
- * @property string $ORDER_SN 订单ID
- * @property string $GOODS_TITLE 商品名称
- * @property string $PRICE 价格
- * @property string $REAL_PRICE 实际价格
- * @property string $PV 订货PV
- * @property string $REAL_PV 实际PV
- * @property string $POINT 兑换积分
- * @property int $PERIOD_NUM 期数
- * @property string $SKU_CODE 商品编码
- * @property int $BUY_NUMS 购买数量
- * @property string $P_CALC_MONTH 分区日期
- */
-class OrderGoodsShop extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER_GOODS_SHOP}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ORDER_SN', 'GOODS_TITLE', 'SKU_CODE'], 'required'],
-            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT'], 'number'],
-            [['BUY_NUMS', 'PERIOD_NUM'], 'integer'],
-            [['ID', 'ORDER_SN'], 'string', 'max' => 32],
-            [['GOODS_TITLE'], 'string', 'max' => 255],
-            [['SKU_CODE'], 'string', 'max' => 16],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'ORDER_SN' => '订单ID',
-            'GOODS_TITLE' => '商品名称',
-            'PRICE' => '价格',
-            'REAL_PRICE' => '实际价格',
-            'PV' => '订货PV',
-            'REAL_PV' => '实际PV',
-            'POINT' => '兑换积分',
-            'PERIOD_NUM' => '期数',
-            'SKU_CODE' => '商品编码',
-            'BUY_NUMS' => '购买数量',
-            'P_CALC_MONTH' => '分区日期',
-        ];
-    }
-}
+<?php
+
+namespace common\models;
+
+use Yii;
+
+/**
+ * This is the model class for table "{{%ORDER_GOODS}}".
+ *
+ * @property string $ID
+ * @property string $ORDER_SN 订单ID
+ * @property string $GOODS_TITLE 商品名称
+ * @property string $PRICE 价格
+ * @property string $REAL_PRICE 实际价格
+ * @property string $PV 订货PV
+ * @property string $REAL_PV 实际PV
+ * @property string $POINT 兑换积分
+ * @property int $PERIOD_NUM 期数
+ * @property string $SKU_CODE 商品编码
+ * @property int $BUY_NUMS 购买数量
+ * @property string $P_CALC_MONTH 分区日期
+ */
+class OrderGoodsShop extends \common\components\ActiveRecord
+{
+    /**
+     * {@inheritdoc}
+     */
+    public static function tableName()
+    {
+        return '{{%ORDER_GOODS_SHOP}}';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function rules()
+    {
+        return [
+            [['ORDER_SN', 'GOODS_TITLE', 'SKU_CODE'], 'required'],
+            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT'], 'number'],
+            [['BUY_NUMS', 'PERIOD_NUM'], 'integer'],
+            [['ID', 'ORDER_SN'], 'string', 'max' => 32],
+            [['GOODS_TITLE'], 'string', 'max' => 255],
+            [['SKU_CODE'], 'string', 'max' => 16],
+            [['ID'], 'unique'],
+        ];
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function attributeLabels()
+    {
+        return [
+            'ID' => 'ID',
+            'ORDER_SN' => '订单ID',
+            'GOODS_TITLE' => '商品名称',
+            'PRICE' => '价格',
+            'REAL_PRICE' => '实际价格',
+            'PV' => '订货PV',
+            'REAL_PV' => '实际PV',
+            'POINT' => '兑换点数',
+            'PERIOD_NUM' => '期数',
+            'SKU_CODE' => '商品编码',
+            'BUY_NUMS' => '购买数量',
+            'P_CALC_MONTH' => '分区日期',
+        ];
+    }
+}

+ 0 - 0
common/models/PerfMonthPrepare.php


+ 0 - 0
common/models/PerfOrderPrepare.php


+ 0 - 0
common/models/PerfPeriodPrepare.php


+ 0 - 0
common/models/PeriodPrepare.php


+ 175 - 175
common/models/ShopGoods.php

@@ -1,175 +1,175 @@
-<?php
-
-namespace common\models;
-
-/**
- * This is the model class for table "{{%SHOP_GOODS}}".
- *
- * @property string $ID
- * @property string $GOODS_NAME 商品名称
- * @property string $CATE_ID 所属分类ID
- * @property string $TYPE 商品来源
- * @property string $GIFT_TYPE 商品类型
- * @property string $SELL_TYPE 允许购买方式
- * @property int $GOODS_NO 商品编号
- * @property string $UNIT 单位
- * @property string $COVER 商品封面
- * @property int $IMAGES 商品图片
- * @property string $CONTENT 商品内容
- * @property string $SELL_PRICE 销售价格
- * @property string $MARKET_PRICE 市场价格
- * @property int $PRICE_PV 价格PV
- * @property int $POINT 兑换积分
- * @property int $STORE_NUMS 库存
- * @property int $IS_DEL 是否删除
- * @property int $CREATED_AT 创建时间
- * @property int $UPDATED_AT 更新时间
- * @property int $DELETED_AT 删除时间
- * @property int $STATUS 状态
- * @property string $SORT 排序
- */
-class ShopGoods extends \common\components\ActiveRecord
-{
-    const SALE_TYPE = [
-        1 => [
-            'name' => '余额购买',
-        ],
-        2 => [
-            'name' => '复消兑换',
-        ],
-        3 => [
-            'name' => '积分兑换'
-        ]
-    ];
-    const GOODS_TYPE = [
-        1 =>[
-            'name'=>'国内商品',
-            'discount'=>'50',
-        ],
-        2 =>[
-            'name'=>'进口商品',
-            'discount'=>'60',
-        ],
-    ];
-    const GIFT_TYPE = [
-        1 =>[
-            'name'=>'报单区',
-        ],
-        2 =>[
-            'name'=>'复消区',
-        ],
-        3 =>[
-            'name'=>'工作室报单',
-        ],
-        4 =>[
-            'name'=>'工作室复消',
-        ],
-    ];
-    const STATUS_NAME = [
-        1 => '已上架',
-        0 => '已下架',
-    ];
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%SHOP_GOODS}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['SELL_DISCOUNT','GOODS_NAME', 'CATE_ID','GIFT_TYPE', 'GOODS_NO', 'SELL_PRICE','MARKET_PRICE','PRICE_PV','STORE_NUMS'], 'required'],
-            [['STORE_NUMS'], 'integer'],
-            [['SELL_PRICE','MARKET_PRICE','PRICE_PV','POINT'], 'number'],
-            [['ID','CATE_ID', 'GOODS_NO','SELL_TYPE','GIFT_TYPE'], 'string', 'max' => 32],
-            [['UNIT'], 'string', 'max' => 16],
-            [['COVER', 'GOODS_NAME'], 'string', 'max' => 255],
-            [['IMAGES','CONTENT'], 'string', 'max' => 4000],
-            [['GOODS_NAME'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'GOODS_NAME' => '商品名称',
-            'CATE_ID' => '所属分类ID',
-            // 'TYPE' => '商品来源',
-            'SELL_DISCOUNT' => '会员折扣',
-            'GIFT_TYPE' => '商品类型',
-            'SELL_TYPE' => '出售方式',
-            'GOODS_NO' => '商品编号',
-            'UNIT' => '商品单位',
-            'COVER' => '商品封面',
-            'IMAGES' => '商品图片',
-            'CONTENT' => '商品内容',
-            'SELL_PRICE' => '销售价格',
-            'MARKET_PRICE' => '市场价格',
-            'PRICE_PV' => '价格PV',
-            'POINT' => '兑换积分',
-            'STORE_NUMS' => '库存',
-            'STATUS' => '是否上架',
-            'IS_DEL' => '是否删除',
-            'CREATED_AT' => '创建时间',
-            'UPDATED_AT' => '更新时间',
-            'DELETED_AT' => '更新时间',
-            'SORT' => '排序',
-        ];
-    }
-
-    /**
-     * 判断提现状态
-     * @param $nowStatus
-     * @param $toStatus
-     * @return string
-     */
-    public static function chkAuditStatus($nowStatus, $toStatus) {
-        $statusName = self::STATUS_NAME;
-        $msg = '当前商品状态为【' . $statusName[$nowStatus] . '】,无法设置为【' . $statusName[$toStatus] . '】';
-        switch ($toStatus) {
-            // 下架
-            case 0:
-                if ($nowStatus == 1) {
-                    $msg = '';
-                }
-                break;
-            //上架
-            case 1:
-                if ($nowStatus == 0) {
-                    $msg = '';
-                }
-                break;
-            default:
-        }
-        return $msg;
-    }
-
-    /**
-     * 支付方式
-     * @return array
-     */
-    public static function payTypes(){
-        return [
-            'cash'=>[
-                'name'=>'余额支付'
-            ],
-            'point'=>[
-                'name'=>'积分支付'
-            ],
-            'exchange' => [
-                'name' => '无业绩兑换券'
-            ]
-        ];
-    }
-
-}
+<?php
+
+namespace common\models;
+
+/**
+ * This is the model class for table "{{%SHOP_GOODS}}".
+ *
+ * @property string $ID
+ * @property string $GOODS_NAME 商品名称
+ * @property string $CATE_ID 所属分类ID
+ * @property string $TYPE 商品来源
+ * @property string $GIFT_TYPE 商品类型
+ * @property string $SELL_TYPE 允许购买方式
+ * @property int $GOODS_NO 商品编号
+ * @property string $UNIT 单位
+ * @property string $COVER 商品封面
+ * @property int $IMAGES 商品图片
+ * @property string $CONTENT 商品内容
+ * @property string $SELL_PRICE 销售价格
+ * @property string $MARKET_PRICE 市场价格
+ * @property int $PRICE_PV 价格PV
+ * @property int $POINT 兑换积分
+ * @property int $STORE_NUMS 库存
+ * @property int $IS_DEL 是否删除
+ * @property int $CREATED_AT 创建时间
+ * @property int $UPDATED_AT 更新时间
+ * @property int $DELETED_AT 删除时间
+ * @property int $STATUS 状态
+ * @property string $SORT 排序
+ */
+class ShopGoods extends \common\components\ActiveRecord
+{
+    const SALE_TYPE = [
+        1 => [
+            'name' => '余额购买',
+        ],
+        2 => [
+            'name' => '复消兑换',
+        ],
+        3 => [
+            'name' => '积分兑换'
+        ]
+    ];
+    const GOODS_TYPE = [
+        1 =>[
+            'name'=>'国内商品',
+            'discount'=>'50',
+        ],
+        2 =>[
+            'name'=>'进口商品',
+            'discount'=>'60',
+        ],
+    ];
+    const GIFT_TYPE = [
+        1 =>[
+            'name'=>'报单区',
+        ],
+        2 =>[
+            'name'=>'复消区',
+        ],
+        3 =>[
+            'name'=>'工作室报单',
+        ],
+        4 =>[
+            'name'=>'工作室复消',
+        ],
+    ];
+    const STATUS_NAME = [
+        1 => '已上架',
+        0 => '已下架',
+    ];
+    /**
+     * @inheritdoc
+     */
+    public static function tableName()
+    {
+        return '{{%SHOP_GOODS}}';
+    }
+
+    /**
+     * @inheritdoc
+     */
+    public function rules()
+    {
+        return [
+            [['SELL_DISCOUNT','GOODS_NAME', 'CATE_ID','GIFT_TYPE', 'GOODS_NO', 'SELL_PRICE','MARKET_PRICE','PRICE_PV','STORE_NUMS'], 'required'],
+            [['STORE_NUMS'], 'integer'],
+            [['SELL_PRICE','MARKET_PRICE','PRICE_PV','POINT'], 'number'],
+            [['ID','CATE_ID', 'GOODS_NO','SELL_TYPE','GIFT_TYPE'], 'string', 'max' => 32],
+            [['UNIT'], 'string', 'max' => 16],
+            [['COVER', 'GOODS_NAME'], 'string', 'max' => 255],
+            [['IMAGES','CONTENT'], 'string', 'max' => 4000],
+            [['GOODS_NAME'], 'unique'],
+            [['ID'], 'unique'],
+        ];
+    }
+
+    /**
+     * @inheritdoc
+     */
+    public function attributeLabels()
+    {
+        return [
+            'ID' => 'ID',
+            'GOODS_NAME' => '商品名称',
+            'CATE_ID' => '所属分类ID',
+            // 'TYPE' => '商品来源',
+            'SELL_DISCOUNT' => '会员折扣',
+            'GIFT_TYPE' => '商品类型',
+            'SELL_TYPE' => '出售方式',
+            'GOODS_NO' => '商品编号',
+            'UNIT' => '商品单位',
+            'COVER' => '商品封面',
+            'IMAGES' => '商品图片',
+            'CONTENT' => '商品内容',
+            'SELL_PRICE' => '销售价格',
+            'MARKET_PRICE' => '市场价格',
+            'PRICE_PV' => '价格PV',
+            'POINT' => '兑换点数',
+            'STORE_NUMS' => '库存',
+            'STATUS' => '是否上架',
+            'IS_DEL' => '是否删除',
+            'CREATED_AT' => '创建时间',
+            'UPDATED_AT' => '更新时间',
+            'DELETED_AT' => '更新时间',
+            'SORT' => '排序',
+        ];
+    }
+
+    /**
+     * 判断提现状态
+     * @param $nowStatus
+     * @param $toStatus
+     * @return string
+     */
+    public static function chkAuditStatus($nowStatus, $toStatus) {
+        $statusName = self::STATUS_NAME;
+        $msg = '当前商品状态为【' . $statusName[$nowStatus] . '】,无法设置为【' . $statusName[$toStatus] . '】';
+        switch ($toStatus) {
+            // 下架
+            case 0:
+                if ($nowStatus == 1) {
+                    $msg = '';
+                }
+                break;
+            //上架
+            case 1:
+                if ($nowStatus == 0) {
+                    $msg = '';
+                }
+                break;
+            default:
+        }
+        return $msg;
+    }
+
+    /**
+     * 支付方式
+     * @return array
+     */
+    public static function payTypes(){
+        return [
+            'cash'=>[
+                'name'=>'余额支付'
+            ],
+            'point'=>[
+                'name'=>'积分支付'
+            ],
+            'exchange' => [
+                'name' => '无业绩兑换点数'
+            ]
+        ];
+    }
+
+}

+ 1 - 0
common/models/Transfer.php

@@ -37,6 +37,7 @@ class Transfer extends \common\components\ActiveRecord
     const WALLET_NAME = [
         'bonus'=>'奖金',
         'cash'=>'余额',
+        'point'=>'复消积分'
     ];
 
     /**

+ 59 - 59
common/models/UserPeriodExchangePoints.php

@@ -1,59 +1,59 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%USER_PERIOD_POINTS}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property int $PERIOD_NUM 报单期数
- * @property string $EXCHANGE_POINTS 兑换积分
- * @property string $REMAINDER_POINTS 剩余积分
- * @property int EXPIRED 是否过期
- * @property int EXPIRED_PERIOD 过期期数
- * @property int EXPIRED_AT 过期时间
- * @property int $CREATED_AT 创建时间
- */
-class UserPeriodExchangePoints extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%USER_PERIOD_EXCHANGE_POINTS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'PERIOD_NUM', 'CREATED_AT'], 'required'],
-            [['PERIOD_NUM', 'CREATED_AT', 'EXPIRED', 'EXPIRED_PERIOD', 'EXPIRED_AT'], 'integer'],
-            [['EXCHANGE_POINTS', 'REMAINDER_POINTS'], 'number'],
-            [['ID', 'USER_ID'], 'string', 'max' => 32],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'EXCHANGE_POINTS' => '兑换积分',
-            'REMAINDER_POINTS' => '剩余积分',
-            'EXPIRED' => '是否过期',
-            'EXPIRED_PERIOD' => '过期期数',
-            'EXPIRED_AT' => '过期时间',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}
+<?php
+
+namespace common\models;
+
+use Yii;
+
+/**
+ * This is the model class for table "{{%USER_PERIOD_POINTS}}".
+ *
+ * @property string $ID
+ * @property string $USER_ID 会员ID
+ * @property int $PERIOD_NUM 报单期数
+ * @property string $EXCHANGE_POINTS 兑换点数
+ * @property string $REMAINDER_POINTS 剩余点数
+ * @property int EXPIRED 是否过期
+ * @property int EXPIRED_PERIOD 过期期数
+ * @property int EXPIRED_AT 过期时间
+ * @property int $CREATED_AT 创建时间
+ */
+class UserPeriodExchangePoints extends \common\components\ActiveRecord
+{
+    /**
+     * {@inheritdoc}
+     */
+    public static function tableName()
+    {
+        return '{{%USER_PERIOD_EXCHANGE_POINTS}}';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function rules()
+    {
+        return [
+            [['USER_ID', 'PERIOD_NUM', 'CREATED_AT'], 'required'],
+            [['PERIOD_NUM', 'CREATED_AT', 'EXPIRED', 'EXPIRED_PERIOD', 'EXPIRED_AT'], 'integer'],
+            [['EXCHANGE_POINTS', 'REMAINDER_POINTS'], 'number'],
+            [['ID', 'USER_ID'], 'string', 'max' => 32],
+        ];
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function attributeLabels()
+    {
+        return [
+            'ID' => 'ID',
+            'USER_ID' => '会员ID',
+            'EXCHANGE_POINTS' => '兑换点数',
+            'REMAINDER_POINTS' => '剩余点数',
+            'EXPIRED' => '是否过期',
+            'EXPIRED_PERIOD' => '过期期数',
+            'EXPIRED_AT' => '过期时间',
+            'CREATED_AT' => '创建时间',
+        ];
+    }
+}

+ 610 - 610
common/models/forms/OrderForm.php

@@ -1,610 +1,610 @@
-<?php
-namespace common\models\forms;
-
-use common\helpers\Cache;
-use common\helpers\Date;
-use common\components\Model;
-use common\helpers\Form;
-use common\helpers\user\Balance;
-use common\helpers\user\Cash;
-use common\helpers\user\Info;
-use common\libs\logging\operate\AdminOperate;
-use common\models\DealType;
-use common\models\Order;
-use common\models\OrderGoods;
-use common\models\Period;
-use common\models\ReceiveAddress;
-use common\models\Region;
-use common\models\ShopGoods;
-use common\models\User;
-use common\models\UserNetwork;
-use yii\base\Exception;
-
-/**
- * Login form
- */
-class OrderForm extends Model
-{
-    public $sn;
-    public $expressCompany;
-    public $orderTrackNo;
-    public $status;
-    public $remark;
-
-    public $type;
-    public $addressId;
-    public $payType;
-    public $goodsId;
-    public $goodsNum;
-    public $payPassword;
-
-    public $userName;
-    public $consignee;
-    public $acceptMobile;
-    public $province;
-    public $city;
-    public $county;
-    public $detailaddress;
-
-    private $_address;
-    private $_decAmount;
-    private $_decPv;
-    private $_freight;
-    private $_payAmount;
-    private $_orderGoods;
-
-    /**
-     * @var Order
-     */
-    private $_model;
-
-    public function init() {
-        parent::init();
-        $this->adminOperateLogger = new AdminOperate([
-            'fetchClass' => Order::class,
-        ]);
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['sn', 'expressCompany', 'orderTrackNo', 'status', 'remark','type','addressId','payType','goodsId','goodsNum', 'payPassword','userName','consignee','acceptMobile','province','city','county','detailaddress'], 'trim'],
-            [['sn', 'expressCompany', 'orderTrackNo', 'status', 'remark','type','addressId','payType','goodsId','goodsNum', 'payPassword','userName','consignee','acceptMobile','province','city','county','detailaddress'], 'required'],
-            [['status'], 'isStatus'],
-            [['addressId'], 'isAddress'],
-            [['payType'], 'isPayType'],
-            [['payPassword'], 'validatePassword'],
-        ];
-    }
-
-    public function attributeLabels()
-    {
-        return [
-            'sn' => '订单号',
-            'expressCompany' => '快递公司',
-            'orderTrackNo' => '快递单号',
-            'status' => '状态',
-            'remark' => '备注',
-            'type' => '订单类型',
-            'addressId' => '收货地址',
-            'payType' => '支付方式',
-            'goodsId' => '商品ID',
-            'goodsNum' => '商品数量',
-            'userName' => '复消会员编号',
-            'consignee' => '收货人',
-            'acceptMobile' => '收货电话',
-            'province' => '省',
-            'city' => '市',
-            'county' => '区',
-            'detailaddress' => '收货详细地址',
-        ];
-    }
-
-    /**
-     * 指定校验场景
-     * @return array
-     */
-    public function scenarios()
-    {
-        $parentScenarios =  parent::scenarios();
-        $customScenarios = [
-            // 管理员发货
-            'adminDelivery' => ['sn', 'expressCompany', 'orderTrackNo'],
-            // 会员确认收货
-            'userConfirm' => ['sn', 'expressCompany', 'orderTrackNo'],
-            // 管理员修改订单状态
-            'adminStatus' => ['sn', 'status'],
-            // 管理员修改备注
-            'adminRemark' => ['sn', 'remark'],
-            // 会员下单
-            'userOrder' => ['type','addressId', 'payType','goodsId','goodsNum', 'remark', 'payPassword'],
-            // 帮会员复消下单
-            'reconsumeOrder' => ['type','userName', 'payType','goodsId','goodsNum', 'remark', 'payPassword','consignee','acceptMobile','province','city','county','detailaddress'],
-        ];
-        return array_merge($parentScenarios, $customScenarios);
-    }
-
-    /**
-     * 校验之前
-     * @return bool
-     */
-    public function beforeValidate()
-    {
-        $parentValidate = parent::beforeValidate();
-        if ($this->sn) {
-            $this->_model = Order::findOne(['SN'=>$this->sn]);
-            if (!$this->_model){
-                $this->addError('sn', '订单不存在');
-                return false;
-            }
-        }
-        if ($this->scenario == 'adminDelivery'){
-            if($this->_model['STATUS'] == \Yii::$app->params['orderStatus']['cancel']) {
-                $this->addError('sn', '订单已取消不能发货');
-                return false;
-            }
-            if($this->_model['STATUS'] == \Yii::$app->params['orderStatus']['del']) {
-                $this->addError('sn', '订单已删除不能发货');
-                return false;
-            }
-        }
-
-        return $parentValidate;
-    }
-
-    /**
-     * 校验支付密码
-     * @param $attribute
-     * @param $params
-     */
-    public function validatePassword($attribute, $params) {
-        if (!User::validatePayPassword(\Yii::$app->user->id, $this->payPassword)) {
-            $this->addError($attribute, '支付密码不正确');
-        }
-    }
-
-    /**
-     * 判断收货地址是否存在
-     * @param $attribute
-     */
-    public function isAddress($attribute){
-        if (!$receiveAddress = ReceiveAddress::find()->where(' ID=:ID', [':ID' => $this->addressId])->asArray()->one()) {
-            $this->addError($attribute, '收货地址不存在');
-        } else {
-            $this->_address = $receiveAddress;
-        }
-    }
-
-    /**
-     * 判断支付方式
-     * @param $attribute
-     */
-    public function isPayType($attribute){
-        if(!array_key_exists($this->payType, ShopGoods::payTypes())){
-            $this->addError($attribute, '支付方式错误');
-            return;
-        }
-    }
-
-    /**
-     * 校验类型
-     * @param $attribute
-     */
-    public function isStatus($attribute){
-        if(!in_array($this->type, \Yii::$app->params['orderStatus'])){
-            $this->addError($attribute, '类型错误');
-            return ;
-        }
-        if ($this->scenario == 'adminStatus'){
-            if ($this->status == $this->_model['STATUS']) {
-                $this->addError($attribute, '订单状态没有改变');
-                return ;
-            }
-            if($this->status == \Yii::$app->params['orderStatus']['notPaid'] && $this->_model['STATUS'] >= \Yii::$app->params['orderStatus']['delivery']) {
-                $this->addError($attribute, '订单已经进入物流状态不能改为未支付');
-                return ;
-            }
-            elseif($this->status == \Yii::$app->params['orderStatus']['paid'] && $this->_model['STATUS'] >= \Yii::$app->params['orderStatus']['cancel']) {
-                $this->addError($attribute, '订单已失效不能处理');
-                return ;
-            }
-            elseif($this->status == \Yii::$app->params['orderStatus']['delivery']) {
-                $this->addError($attribute, '订单不能单独处理为物流状态');
-                return ;
-            }
-            elseif($this->status == \Yii::$app->params['orderStatus']['complete'] && $this->_model['STATUS'] > \Yii::$app->params['orderStatus']['cancel']) {
-                $this->addError($attribute, '订单已失效不能处理');
-                return ;
-            }
-            elseif($this->status == \Yii::$app->params['orderStatus']['cancel']) {
-                if($this->_model['STATUS'] == \Yii::$app->params['orderStatus']['complete']) {
-                    $this->addError($attribute, '订单已完成不能取消');
-                    return ;
-                }
-                if($this->_model['STATUS'] == \Yii::$app->params['orderStatus']['del']) {
-                    $this->addError($attribute, '订单已删除不能取消');
-                    return ;
-                }
-            }
-            elseif($this->status == \Yii::$app->params['orderStatus']['del']) {
-                if($this->_model['STATUS'] == \Yii::$app->params['orderStatus']['complete']) {
-                    $this->addError($attribute, '订单已完成不能删除');
-                    return ;
-                }
-            }
-        }
-
-    }
-
-    /**
-     * 管理员发货
-     * @return Order|null
-     * @throws \yii\db\Exception
-     */
-    public function adminDelivery(){
-        if(!$this->validate()){
-            return null;
-        }
-        $db = \Yii::$app->db;
-        $transaction = $db->beginTransaction();
-        try {
-            $period = Period::instance();
-            $this->_model->DELIVERY_STATUS = \Yii::$app->params['deliveryStatus']['delivered']['value'];
-            $this->_model->DELIVERY_PERIOD = $period->getNowPeriodNum();
-            $this->_model->DELIVERY_AT = Date::nowTime();
-            $this->_model->EXPRESS_COMPANY = $this->expressCompany;
-            $this->_model->ORDER_TRACK_NO = $this->orderTrackNo;
-            $this->_model->STATUS = \Yii::$app->params['orderStatus']['delivery']['value'];
-            if(!$this->_model->save()){
-                throw new Exception(Form::formatErrorsForApi($this->_model->getErrors()));
-            }
-            $transaction->commit();
-        } catch (Exception $e) {
-            $transaction->rollBack();
-            $this->addError('edit', $e->getMessage());
-            return null;
-        }
-        return $this->_model;
-    }
-
-    /**
-     * 复销
-     * @return bool|null
-     * @throws Exception
-     * @throws \yii\db\Exception
-     */
-    public function add(){
-        if(!$this->validate()){
-            return null;
-        }
-        $ids = $this->goodsId;
-        $totalAmount = 0;
-        $totalPv = 0;
-        $goodsType = ShopGoods::GOODS_TYPE;
-        foreach ($this->goodsNum as $k => $v) {
-            if ($v) {
-                $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
-                if($goods['STORE_NUMS']>0){
-                    if ($goods['TYPE'] == 1 || $goods['TYPE'] == 2) {
-                        $discount = $goodsType[$goods['TYPE']]['discount'];
-                        $realPrice = $goods['SELL_PRICE'] * $discount/100;
-                        $realPv = $goods['PRICE_PV'] * $discount/100;
-                    } else {
-                        $discount = $goods['SELL_DISCOUNT'];
-                        $realPrice = $goods['SELL_PRICE'] * $discount;
-                        $realPv = $goods['PRICE_PV'] * $discount;
-                    }
-                    $totalAmount += $realPrice * intval($v);
-                    $totalPv += $realPv * intval($v);
-//                    if($this->payType=='cash') {
-//                        $discount = $goodsType[$goods['TYPE']]['discount'];
-//                        $realPrice = $goods['SELL_PRICE'] * $discount/100;
-//                        $realPv = $goods['PRICE_PV'] * $discount/100;
-//                        $totalAmount += $realPrice * intval($v);
-//                        $totalPv += $realPv * intval($v);
-//                    }else{
-//                        $realPrice = $goods['SELL_PRICE'];
-//                        $realPv = $goods['PRICE_PV'];
-//                        $totalAmount += $realPrice * intval($v);
-//                        $totalPv += $realPv * intval($v);
-//                    }
-                    $this->_orderGoods[] = [
-                        'GOODS_ID' => $goods['ID'],
-                        'PRICE' => $goods['SELL_PRICE'],
-                        'PV' => $goods['PRICE_PV'],
-                        'REAL_PRICE' => $realPrice,
-                        'REAL_PV' => $realPv,
-                        'POINT' => $goods['POINT'],
-                        'BUY_NUMS' => intval($v),
-                        'SKU_CODE' => $goods['GOODS_NO'],
-                        'GOODS_TITLE' => $goods['GOODS_NAME']
-                    ];
-                }
-            }
-        }
-        $this->_decAmount = $totalAmount;
-        $this->_decPv = $totalPv;
-        $this->_freight = ($totalAmount>=300) ? 0 : 15;
-        $this->_payAmount = $this->_decAmount + $this->_freight;
-
-
-        $db = \Yii::$app->db;
-        $transaction = $db->beginTransaction();
-        try {
-            //判断用户余额是否充足
-            $loginUserId = \Yii::$app->user->id;
-            if($this->payType=='cash') {
-                if (Cash::getAvailableBalance($loginUserId) < $this->_payAmount) {
-                    throw new Exception('余额不足,无法购买商品');
-                }
-            } else if ($this->payType =='exchange') {
-                if ($this->_payAmount > Balance::getBalanceExchangePoints($loginUserId)) {
-                    throw new Exception('兑换积分不足,无法购买商品');
-                }
-            } else{
-                if ($this->_payAmount > Balance::getBalanceReconsumePoints($loginUserId)) {
-                    throw new Exception('复消积分不足,无法购买商品');
-                }
-            }
-            //写入订单
-            if (!$orderResult = $this->addOrder()) {
-                throw new Exception(Form::formatErrorsForApi($orderResult->getErrors()));
-            }
-            $transaction->commit();
-        }catch (\Exception $e){
-            $transaction->rollBack();
-            $this->addError('add', $e->getMessage());
-            return null;
-        }
-        return true;
-    }
-
-    /**
-     * 复销订单
-     */
-    public function addOrder(){
-        $periodObj = Period::instance();
-        $nowPeriodNum = $periodObj->getNowPeriodNum();
-        $nowCalcMonth = $periodObj->getYearMonth($nowPeriodNum);
-
-        $userId = \Yii::$app->user->id;
-        $userName = Info::getUserNameByUserId($userId);
-
-        // 加入订单信息
-        $warehouse = Region::getWarehouseByCode($this->_address['PROVINCE']);//仓库
-        if(!$warehouse){
-            throw new Exception('地区暂时不支持配送,具体联系客服');
-        }
-        $ordNo = $this->_generateSn();
-        $orderModel = new Order();
-        $orderModel->SN = 'OS'.$ordNo;
-        $orderModel->DEC_SN = 'DS'.$ordNo;
-        $orderModel->ORDER_TYPE = $this->type;
-        $orderModel->USER_ID = $userId;
-        $orderModel->USER_NAME = $userName;
-        $orderModel->ORDER_AMOUNT = $this->_decAmount;
-        $orderModel->PV = $this->payType =='exchange' ? 0 : $this->_decPv;
-        $orderModel->PAY_AMOUNT = $this->_payAmount;
-        $orderModel->PAY_PV = $this->payType =='exchange' ? 0 : $this->_decPv; // 兑换积分不能算业绩
-        $orderModel->PAY_AT = Date::nowTime();
-        $orderModel->PAY_TYPE = $this->payType;
-        $orderModel->PERIOD_NUM = $nowPeriodNum;
-        $orderModel->P_CALC_MONTH = Date::ociToDate($nowCalcMonth, Date::OCI_TIME_FORMAT_SHORT_MONTH);
-        $orderModel->FREIGHT = $this->_freight;
-        $orderModel->PAY_FREIGHT = $this->_freight;
-        $orderModel->CONSIGNEE = $this->_address['CONSIGNEE'];
-        $orderModel->MOBILE = $this->_address['MOBILE'];
-        $orderModel->PROVINCE = $this->_address['PROVINCE'];
-        $orderModel->CITY = $this->_address['CITY'];
-        $orderModel->COUNTY = $this->_address['COUNTY'];
-        $orderModel->ADDRESS = $this->_address['ADDRESS'];
-        $orderModel->FRONT_REMARK = $this->remark;
-        $orderModel->WAREHOUSE = $warehouse;
-        $orderModel->STATUS = 1;
-        $orderModel->CREATED_AT = Date::nowTime();
-        $orderModel->CREATE_USER = $userName;
-        if(!$orderModel->save()){
-            $this->addErrors($orderModel->getErrors());
-            return false;
-        }
-        // 加入商品到订单商品表
-        foreach($this->_orderGoods as $key=>$value){
-            // 增加判断,如果订单是兑换券购买,则AR_ORDER_GOODS中的REAL_PV真实PV应该是0
-            if ($orderModel->PAY_TYPE == 'exchange') {
-                $this->_orderGoods[$key]['REAL_PV'] = 0;
-            }
-            $this->_orderGoods[$key]['ORDER_SN'] = $orderModel->SN;
-            $this->_orderGoods[$key]['P_CALC_MONTH'] = Date::ociToDate($nowCalcMonth, Date::OCI_TIME_FORMAT_SHORT_MONTH);
-        }
-        OrderGoods::batchInsert($this->_orderGoods);
-
-        //扣除会员余额/积分
-        if($this->payType=='cash') {
-            Cash::changeUserCash(\Yii::$app->user->id, 'CASH', -abs($this->_payAmount), ['REMARK' => '会员复销余额支付']);
-        } else if ($this->payType=='exchange') {
-            Balance::changeUserBonus(\Yii::$app->user->id,'exchange_points', -abs($this->_payAmount),['DEAL_TYPE_ID' => DealType::EXCHANGE_POINTS_EXCHANGE,'REMARK' => '会员兑换积分兑换']);
-        } else{
-            Balance::changeUserBonus(\Yii::$app->user->id,'reconsume_points', -abs($this->_payAmount),['DEAL_TYPE_ID' => DealType::RECONSUME_POINTS_EXCHANGE,'REMARK' => '会员复销积分兑换']);
-        }
-        return $orderModel;
-    }
-
-    /**
-     * 帮会员复销
-     * @return bool|null
-     * @throws Exception
-     * @throws \yii\db\Exception
-     */
-    public function reconsumeAdd(){
-        if(!$this->validate()){
-            return null;
-        }
-        $ids = $this->goodsId;
-        $totalAmount = 0;
-        $totalPv = 0;
-        $goodsType = ShopGoods::GOODS_TYPE;
-        foreach ($this->goodsNum as $k => $v) {
-            if ($v) {
-                $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
-                if($goods['STORE_NUMS']>0){
-                    if ($goods['TYPE'] == 1 || $goods['TYPE'] == 2) {
-                        $discount = $goodsType[$goods['TYPE']]['discount'];
-                        $realPrice = $goods['SELL_PRICE'] * $discount/100;
-                        $realPv = $goods['PRICE_PV'] * $discount/100;
-                    } else {
-                        $discount = $goods['SELL_DISCOUNT'];
-                        $realPrice = $goods['SELL_PRICE'] * $discount;
-                        $realPv = $goods['PRICE_PV'] * $discount;
-                    }
-                    $totalAmount += $realPrice * intval($v);
-                    $totalPv += $realPv * intval($v);
-                    $this->_orderGoods[] = [
-                        'GOODS_ID' => $goods['ID'],
-                        'PRICE' => $goods['SELL_PRICE'],
-                        'PV' => $goods['PRICE_PV'],
-                        'REAL_PRICE' => $realPrice,
-                        'REAL_PV' => $realPv,
-                        'POINT' => $goods['POINT'],
-                        'BUY_NUMS' => intval($v),
-                        'SKU_CODE' => $goods['GOODS_NO'],
-                        'GOODS_TITLE' => $goods['GOODS_NAME']
-                    ];
-                }
-            }
-        }
-        $this->_decAmount = $totalAmount;
-        $this->_decPv = $totalPv;
-        $this->_freight = ($totalAmount>=300) ? 0 : 15;
-        $this->_payAmount = $this->_decAmount + $this->_freight;
-
-        $db = \Yii::$app->db;
-        $transaction = $db->beginTransaction();
-        try {
-            $loginUserId = \Yii::$app->user->id;
-
-            //是否开启伞下会员限制
-            $isResaleUmbrella = Cache::getSystemConfig()['isResaleUmbrella']['VALUE'];
-            if($isResaleUmbrella){
-                $userId = Info::getUserIdByUserName($this->userName);
-                $userNetwork = UserNetwork::find()->where("USER_ID=:USER_ID AND INSTR(PARENT_UIDS,'{$loginUserId}')>0", ['USER_ID'=>$userId])->count();
-                if(!$userNetwork){
-                    throw new Exception($this->userName.'不是您的伞下会员,不能为其复消!');
-                }
-            }
-            //判断用户余额是否充足
-            if($this->payType=='cash') {
-                if (Cash::getAvailableBalance($loginUserId) < $this->_payAmount) {
-                    throw new Exception('余额不足,无法购买商品');
-                }
-            }else{
-                if ($this->_payAmount > Balance::getBalanceReconsumePoints($loginUserId)) {
-                    throw new Exception('复消积分不足,无法购买商品');
-                }
-            }
-            //写入订单
-            if (!$orderResult = $this->addUserOrder()) {
-                throw new Exception(Form::formatErrorsForApi($orderResult->getErrors()));
-            }
-            $transaction->commit();
-        }catch (\Exception $e){
-            $transaction->rollBack();
-            $this->addError('add', $e->getMessage());
-            return null;
-        }
-        return true;
-    }
-
-    /**
-     * 帮会员复消的订单
-     */
-    public function addUserOrder(){
-        $periodObj = Period::instance();
-        $nowPeriodNum = $periodObj->getNowPeriodNum();
-        $nowCalcMonth = $periodObj->getYearMonth($nowPeriodNum);
-        //帮复消会员Id(登陆会员)
-        $loginUserId = \Yii::$app->user->id;
-        $loginUserName = Info::getUserNameByUserId($loginUserId);
-        //订单会员Id
-        $userId = Info::getUserIdByUserName($this->userName);
-
-        // 加入订单信息
-        $warehouse = Region::getWarehouseByCode($this->province);//仓库
-        if(!$warehouse){
-            throw new Exception('地区暂时不支持配送,具体联系客服');
-        }
-        $ordNo = $this->_generateSn();
-        $orderModel = new Order();
-        $orderModel->SN = 'OS'.$ordNo;
-        $orderModel->DEC_SN = 'DS'.$ordNo;
-        $orderModel->ORDER_TYPE = $this->type;
-        $orderModel->USER_ID = $userId;
-        $orderModel->USER_NAME = $this->userName;
-        $orderModel->ORDER_AMOUNT = $this->_decAmount;
-        $orderModel->PV = $this->_decPv;
-        $orderModel->PAY_AMOUNT = $this->_payAmount;
-        $orderModel->PAY_PV = $this->_decPv;
-        $orderModel->PAY_AT = Date::nowTime();
-        $orderModel->PAY_TYPE = $this->payType;
-        $orderModel->PERIOD_NUM = $nowPeriodNum;
-        $orderModel->P_CALC_MONTH = Date::ociToDate($nowCalcMonth, Date::OCI_TIME_FORMAT_SHORT_MONTH);
-        $orderModel->FREIGHT = $this->_freight;
-        $orderModel->PAY_FREIGHT = $this->_freight;
-        $orderModel->CONSIGNEE = $this->consignee;
-        $orderModel->MOBILE = $this->acceptMobile;
-        $orderModel->PROVINCE = $this->province;
-        $orderModel->CITY = $this->city;
-        $orderModel->COUNTY = $this->county;
-        $orderModel->ADDRESS = $this->detailaddress;
-        $orderModel->FRONT_REMARK = $this->remark;
-        $orderModel->WAREHOUSE = $warehouse;
-        $orderModel->STATUS = 1;
-        $orderModel->CREATED_AT = Date::nowTime();
-        $orderModel->CREATE_USER = $loginUserName;
-        if(!$orderModel->save()){
-            $this->addErrors($orderModel->getErrors());
-            return false;
-        }
-        // 加入商品到订单商品表
-        foreach($this->_orderGoods as $key=>$value){
-            $this->_orderGoods[$key]['ORDER_SN'] = $orderModel->SN;
-            $this->_orderGoods[$key]['P_CALC_MONTH'] = Date::ociToDate($nowCalcMonth, Date::OCI_TIME_FORMAT_SHORT_MONTH);
-        }
-        OrderGoods::batchInsert($this->_orderGoods);
-
-        //扣除会员余额/积分
-        if($this->payType=='cash') {
-            Cash::changeUserCash($loginUserId, 'CASH', -abs($this->_payAmount), ['REMARK' => '会员复销余额支付']);
-        }else{
-            Balance::changeUserBonus($loginUserId,'reconsume_points', -abs($this->_payAmount),['DEAL_TYPE_ID' => DealType::RECONSUME_POINTS_EXCHANGE, 'REMARK' => '会员复销积分兑换']);
-        }
-        return $orderModel;
-    }
-
-    /**
-     * 生成流水号
-     * @return string
-     */
-    private function _generateSn() {
-        return Date::today('Ymd') . $this->_random(10, 1);
-    }
-
-    /**
-     * 生成随机数
-     * @param $length
-     * @param int $numeric
-     * @return string
-     */
-    private function _random($length, $numeric = 0) {
-        $seed = base_convert(md5(microtime() . $_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
-        $seed = $numeric ? (str_replace('0', '', $seed) . '012340567890') : ($seed . 'zZ' . strtoupper($seed));
-        $hash = '';
-        $max = strlen($seed) - 1;
-        for ($i = 0; $i < $length; $i++) {
-            $hash .= $seed[mt_rand(0, $max)];
-        }
-        return $hash;
-    }
-}
+<?php
+namespace common\models\forms;
+
+use common\helpers\Cache;
+use common\helpers\Date;
+use common\components\Model;
+use common\helpers\Form;
+use common\helpers\user\Balance;
+use common\helpers\user\Cash;
+use common\helpers\user\Info;
+use common\libs\logging\operate\AdminOperate;
+use common\models\DealType;
+use common\models\Order;
+use common\models\OrderGoods;
+use common\models\Period;
+use common\models\ReceiveAddress;
+use common\models\Region;
+use common\models\ShopGoods;
+use common\models\User;
+use common\models\UserNetwork;
+use yii\base\Exception;
+
+/**
+ * Login form
+ */
+class OrderForm extends Model
+{
+    public $sn;
+    public $expressCompany;
+    public $orderTrackNo;
+    public $status;
+    public $remark;
+
+    public $type;
+    public $addressId;
+    public $payType;
+    public $goodsId;
+    public $goodsNum;
+    public $payPassword;
+
+    public $userName;
+    public $consignee;
+    public $acceptMobile;
+    public $province;
+    public $city;
+    public $county;
+    public $detailaddress;
+
+    private $_address;
+    private $_decAmount;
+    private $_decPv;
+    private $_freight;
+    private $_payAmount;
+    private $_orderGoods;
+
+    /**
+     * @var Order
+     */
+    private $_model;
+
+    public function init() {
+        parent::init();
+        $this->adminOperateLogger = new AdminOperate([
+            'fetchClass' => Order::class,
+        ]);
+    }
+
+    /**
+     * @inheritdoc
+     */
+    public function rules()
+    {
+        return [
+            [['sn', 'expressCompany', 'orderTrackNo', 'status', 'remark','type','addressId','payType','goodsId','goodsNum', 'payPassword','userName','consignee','acceptMobile','province','city','county','detailaddress'], 'trim'],
+            [['sn', 'expressCompany', 'orderTrackNo', 'status', 'remark','type','addressId','payType','goodsId','goodsNum', 'payPassword','userName','consignee','acceptMobile','province','city','county','detailaddress'], 'required'],
+            [['status'], 'isStatus'],
+            [['addressId'], 'isAddress'],
+            [['payType'], 'isPayType'],
+            [['payPassword'], 'validatePassword'],
+        ];
+    }
+
+    public function attributeLabels()
+    {
+        return [
+            'sn' => '订单号',
+            'expressCompany' => '快递公司',
+            'orderTrackNo' => '快递单号',
+            'status' => '状态',
+            'remark' => '备注',
+            'type' => '订单类型',
+            'addressId' => '收货地址',
+            'payType' => '支付方式',
+            'goodsId' => '商品ID',
+            'goodsNum' => '商品数量',
+            'userName' => '复消会员编号',
+            'consignee' => '收货人',
+            'acceptMobile' => '收货电话',
+            'province' => '省',
+            'city' => '市',
+            'county' => '区',
+            'detailaddress' => '收货详细地址',
+        ];
+    }
+
+    /**
+     * 指定校验场景
+     * @return array
+     */
+    public function scenarios()
+    {
+        $parentScenarios =  parent::scenarios();
+        $customScenarios = [
+            // 管理员发货
+            'adminDelivery' => ['sn', 'expressCompany', 'orderTrackNo'],
+            // 会员确认收货
+            'userConfirm' => ['sn', 'expressCompany', 'orderTrackNo'],
+            // 管理员修改订单状态
+            'adminStatus' => ['sn', 'status'],
+            // 管理员修改备注
+            'adminRemark' => ['sn', 'remark'],
+            // 会员下单
+            'userOrder' => ['type','addressId', 'payType','goodsId','goodsNum', 'remark', 'payPassword'],
+            // 帮会员复消下单
+            'reconsumeOrder' => ['type','userName', 'payType','goodsId','goodsNum', 'remark', 'payPassword','consignee','acceptMobile','province','city','county','detailaddress'],
+        ];
+        return array_merge($parentScenarios, $customScenarios);
+    }
+
+    /**
+     * 校验之前
+     * @return bool
+     */
+    public function beforeValidate()
+    {
+        $parentValidate = parent::beforeValidate();
+        if ($this->sn) {
+            $this->_model = Order::findOne(['SN'=>$this->sn]);
+            if (!$this->_model){
+                $this->addError('sn', '订单不存在');
+                return false;
+            }
+        }
+        if ($this->scenario == 'adminDelivery'){
+            if($this->_model['STATUS'] == \Yii::$app->params['orderStatus']['cancel']) {
+                $this->addError('sn', '订单已取消不能发货');
+                return false;
+            }
+            if($this->_model['STATUS'] == \Yii::$app->params['orderStatus']['del']) {
+                $this->addError('sn', '订单已删除不能发货');
+                return false;
+            }
+        }
+
+        return $parentValidate;
+    }
+
+    /**
+     * 校验支付密码
+     * @param $attribute
+     * @param $params
+     */
+    public function validatePassword($attribute, $params) {
+        if (!User::validatePayPassword(\Yii::$app->user->id, $this->payPassword)) {
+            $this->addError($attribute, '支付密码不正确');
+        }
+    }
+
+    /**
+     * 判断收货地址是否存在
+     * @param $attribute
+     */
+    public function isAddress($attribute){
+        if (!$receiveAddress = ReceiveAddress::find()->where(' ID=:ID', [':ID' => $this->addressId])->asArray()->one()) {
+            $this->addError($attribute, '收货地址不存在');
+        } else {
+            $this->_address = $receiveAddress;
+        }
+    }
+
+    /**
+     * 判断支付方式
+     * @param $attribute
+     */
+    public function isPayType($attribute){
+        if(!array_key_exists($this->payType, ShopGoods::payTypes())){
+            $this->addError($attribute, '支付方式错误');
+            return;
+        }
+    }
+
+    /**
+     * 校验类型
+     * @param $attribute
+     */
+    public function isStatus($attribute){
+        if(!in_array($this->type, \Yii::$app->params['orderStatus'])){
+            $this->addError($attribute, '类型错误');
+            return ;
+        }
+        if ($this->scenario == 'adminStatus'){
+            if ($this->status == $this->_model['STATUS']) {
+                $this->addError($attribute, '订单状态没有改变');
+                return ;
+            }
+            if($this->status == \Yii::$app->params['orderStatus']['notPaid'] && $this->_model['STATUS'] >= \Yii::$app->params['orderStatus']['delivery']) {
+                $this->addError($attribute, '订单已经进入物流状态不能改为未支付');
+                return ;
+            }
+            elseif($this->status == \Yii::$app->params['orderStatus']['paid'] && $this->_model['STATUS'] >= \Yii::$app->params['orderStatus']['cancel']) {
+                $this->addError($attribute, '订单已失效不能处理');
+                return ;
+            }
+            elseif($this->status == \Yii::$app->params['orderStatus']['delivery']) {
+                $this->addError($attribute, '订单不能单独处理为物流状态');
+                return ;
+            }
+            elseif($this->status == \Yii::$app->params['orderStatus']['complete'] && $this->_model['STATUS'] > \Yii::$app->params['orderStatus']['cancel']) {
+                $this->addError($attribute, '订单已失效不能处理');
+                return ;
+            }
+            elseif($this->status == \Yii::$app->params['orderStatus']['cancel']) {
+                if($this->_model['STATUS'] == \Yii::$app->params['orderStatus']['complete']) {
+                    $this->addError($attribute, '订单已完成不能取消');
+                    return ;
+                }
+                if($this->_model['STATUS'] == \Yii::$app->params['orderStatus']['del']) {
+                    $this->addError($attribute, '订单已删除不能取消');
+                    return ;
+                }
+            }
+            elseif($this->status == \Yii::$app->params['orderStatus']['del']) {
+                if($this->_model['STATUS'] == \Yii::$app->params['orderStatus']['complete']) {
+                    $this->addError($attribute, '订单已完成不能删除');
+                    return ;
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 管理员发货
+     * @return Order|null
+     * @throws \yii\db\Exception
+     */
+    public function adminDelivery(){
+        if(!$this->validate()){
+            return null;
+        }
+        $db = \Yii::$app->db;
+        $transaction = $db->beginTransaction();
+        try {
+            $period = Period::instance();
+            $this->_model->DELIVERY_STATUS = \Yii::$app->params['deliveryStatus']['delivered']['value'];
+            $this->_model->DELIVERY_PERIOD = $period->getNowPeriodNum();
+            $this->_model->DELIVERY_AT = Date::nowTime();
+            $this->_model->EXPRESS_COMPANY = $this->expressCompany;
+            $this->_model->ORDER_TRACK_NO = $this->orderTrackNo;
+            $this->_model->STATUS = \Yii::$app->params['orderStatus']['delivery']['value'];
+            if(!$this->_model->save()){
+                throw new Exception(Form::formatErrorsForApi($this->_model->getErrors()));
+            }
+            $transaction->commit();
+        } catch (Exception $e) {
+            $transaction->rollBack();
+            $this->addError('edit', $e->getMessage());
+            return null;
+        }
+        return $this->_model;
+    }
+
+    /**
+     * 复销
+     * @return bool|null
+     * @throws Exception
+     * @throws \yii\db\Exception
+     */
+    public function add(){
+        if(!$this->validate()){
+            return null;
+        }
+        $ids = $this->goodsId;
+        $totalAmount = 0;
+        $totalPv = 0;
+        $goodsType = ShopGoods::GOODS_TYPE;
+        foreach ($this->goodsNum as $k => $v) {
+            if ($v) {
+                $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
+                if($goods['STORE_NUMS']>0){
+                    if ($goods['TYPE'] == 1 || $goods['TYPE'] == 2) {
+                        $discount = $goodsType[$goods['TYPE']]['discount'];
+                        $realPrice = $goods['SELL_PRICE'] * $discount/100;
+                        $realPv = $goods['PRICE_PV'] * $discount/100;
+                    } else {
+                        $discount = $goods['SELL_DISCOUNT'];
+                        $realPrice = $goods['SELL_PRICE'] * $discount;
+                        $realPv = $goods['PRICE_PV'] * $discount;
+                    }
+                    $totalAmount += $realPrice * intval($v);
+                    $totalPv += $realPv * intval($v);
+//                    if($this->payType=='cash') {
+//                        $discount = $goodsType[$goods['TYPE']]['discount'];
+//                        $realPrice = $goods['SELL_PRICE'] * $discount/100;
+//                        $realPv = $goods['PRICE_PV'] * $discount/100;
+//                        $totalAmount += $realPrice * intval($v);
+//                        $totalPv += $realPv * intval($v);
+//                    }else{
+//                        $realPrice = $goods['SELL_PRICE'];
+//                        $realPv = $goods['PRICE_PV'];
+//                        $totalAmount += $realPrice * intval($v);
+//                        $totalPv += $realPv * intval($v);
+//                    }
+                    $this->_orderGoods[] = [
+                        'GOODS_ID' => $goods['ID'],
+                        'PRICE' => $goods['SELL_PRICE'],
+                        'PV' => $goods['PRICE_PV'],
+                        'REAL_PRICE' => $realPrice,
+                        'REAL_PV' => $realPv,
+                        'POINT' => $goods['POINT'],
+                        'BUY_NUMS' => intval($v),
+                        'SKU_CODE' => $goods['GOODS_NO'],
+                        'GOODS_TITLE' => $goods['GOODS_NAME']
+                    ];
+                }
+            }
+        }
+        $this->_decAmount = $totalAmount;
+        $this->_decPv = $totalPv;
+        $this->_freight = ($totalAmount>=300) ? 0 : 15;
+        $this->_payAmount = $this->_decAmount + $this->_freight;
+
+
+        $db = \Yii::$app->db;
+        $transaction = $db->beginTransaction();
+        try {
+            //判断用户余额是否充足
+            $loginUserId = \Yii::$app->user->id;
+            if($this->payType=='cash') {
+                if (Cash::getAvailableBalance($loginUserId) < $this->_payAmount) {
+                    throw new Exception('余额不足,无法购买商品');
+                }
+            } else if ($this->payType =='exchange') {
+                if ($this->_payAmount > Balance::getBalanceExchangePoints($loginUserId)) {
+                    throw new Exception('兑换点数不足,无法购买商品');
+                }
+            } else{
+                if ($this->_payAmount > Balance::getBalanceReconsumePoints($loginUserId)) {
+                    throw new Exception('复消积分不足,无法购买商品');
+                }
+            }
+            //写入订单
+            if (!$orderResult = $this->addOrder()) {
+                throw new Exception(Form::formatErrorsForApi($orderResult->getErrors()));
+            }
+            $transaction->commit();
+        }catch (\Exception $e){
+            $transaction->rollBack();
+            $this->addError('add', $e->getMessage());
+            return null;
+        }
+        return true;
+    }
+
+    /**
+     * 复销订单
+     */
+    public function addOrder(){
+        $periodObj = Period::instance();
+        $nowPeriodNum = $periodObj->getNowPeriodNum();
+        $nowCalcMonth = $periodObj->getYearMonth($nowPeriodNum);
+
+        $userId = \Yii::$app->user->id;
+        $userName = Info::getUserNameByUserId($userId);
+
+        // 加入订单信息
+        $warehouse = Region::getWarehouseByCode($this->_address['PROVINCE']);//仓库
+        if(!$warehouse){
+            throw new Exception('地区暂时不支持配送,具体联系客服');
+        }
+        $ordNo = $this->_generateSn();
+        $orderModel = new Order();
+        $orderModel->SN = 'OS'.$ordNo;
+        $orderModel->DEC_SN = 'DS'.$ordNo;
+        $orderModel->ORDER_TYPE = $this->type;
+        $orderModel->USER_ID = $userId;
+        $orderModel->USER_NAME = $userName;
+        $orderModel->ORDER_AMOUNT = $this->_decAmount;
+        $orderModel->PV = $this->payType =='exchange' ? 0 : $this->_decPv;
+        $orderModel->PAY_AMOUNT = $this->_payAmount;
+        $orderModel->PAY_PV = $this->payType =='exchange' ? 0 : $this->_decPv; // 兑换积分不能算业绩
+        $orderModel->PAY_AT = Date::nowTime();
+        $orderModel->PAY_TYPE = $this->payType;
+        $orderModel->PERIOD_NUM = $nowPeriodNum;
+        $orderModel->P_CALC_MONTH = Date::ociToDate($nowCalcMonth, Date::OCI_TIME_FORMAT_SHORT_MONTH);
+        $orderModel->FREIGHT = $this->_freight;
+        $orderModel->PAY_FREIGHT = $this->_freight;
+        $orderModel->CONSIGNEE = $this->_address['CONSIGNEE'];
+        $orderModel->MOBILE = $this->_address['MOBILE'];
+        $orderModel->PROVINCE = $this->_address['PROVINCE'];
+        $orderModel->CITY = $this->_address['CITY'];
+        $orderModel->COUNTY = $this->_address['COUNTY'];
+        $orderModel->ADDRESS = $this->_address['ADDRESS'];
+        $orderModel->FRONT_REMARK = $this->remark;
+        $orderModel->WAREHOUSE = $warehouse;
+        $orderModel->STATUS = 1;
+        $orderModel->CREATED_AT = Date::nowTime();
+        $orderModel->CREATE_USER = $userName;
+        if(!$orderModel->save()){
+            $this->addErrors($orderModel->getErrors());
+            return false;
+        }
+        // 加入商品到订单商品表
+        foreach($this->_orderGoods as $key=>$value){
+            // 增加判断,如果订单是兑换券购买,则AR_ORDER_GOODS中的REAL_PV真实PV应该是0
+            if ($orderModel->PAY_TYPE == 'exchange') {
+                $this->_orderGoods[$key]['REAL_PV'] = 0;
+            }
+            $this->_orderGoods[$key]['ORDER_SN'] = $orderModel->SN;
+            $this->_orderGoods[$key]['P_CALC_MONTH'] = Date::ociToDate($nowCalcMonth, Date::OCI_TIME_FORMAT_SHORT_MONTH);
+        }
+        OrderGoods::batchInsert($this->_orderGoods);
+
+        //扣除会员余额/积分
+        if($this->payType=='cash') {
+            Cash::changeUserCash(\Yii::$app->user->id, 'CASH', -abs($this->_payAmount), ['REMARK' => '会员复销余额支付']);
+        } else if ($this->payType=='exchange') {
+            Balance::changeUserBonus(\Yii::$app->user->id,'exchange_points', -abs($this->_payAmount),['DEAL_TYPE_ID' => DealType::EXCHANGE_POINTS_EXCHANGE,'REMARK' => '会员兑换积分兑换']);
+        } else{
+            Balance::changeUserBonus(\Yii::$app->user->id,'reconsume_points', -abs($this->_payAmount),['DEAL_TYPE_ID' => DealType::RECONSUME_POINTS_EXCHANGE,'REMARK' => '会员复销积分兑换']);
+        }
+        return $orderModel;
+    }
+
+    /**
+     * 帮会员复销
+     * @return bool|null
+     * @throws Exception
+     * @throws \yii\db\Exception
+     */
+    public function reconsumeAdd(){
+        if(!$this->validate()){
+            return null;
+        }
+        $ids = $this->goodsId;
+        $totalAmount = 0;
+        $totalPv = 0;
+        $goodsType = ShopGoods::GOODS_TYPE;
+        foreach ($this->goodsNum as $k => $v) {
+            if ($v) {
+                $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
+                if($goods['STORE_NUMS']>0){
+                    if ($goods['TYPE'] == 1 || $goods['TYPE'] == 2) {
+                        $discount = $goodsType[$goods['TYPE']]['discount'];
+                        $realPrice = $goods['SELL_PRICE'] * $discount/100;
+                        $realPv = $goods['PRICE_PV'] * $discount/100;
+                    } else {
+                        $discount = $goods['SELL_DISCOUNT'];
+                        $realPrice = $goods['SELL_PRICE'] * $discount;
+                        $realPv = $goods['PRICE_PV'] * $discount;
+                    }
+                    $totalAmount += $realPrice * intval($v);
+                    $totalPv += $realPv * intval($v);
+                    $this->_orderGoods[] = [
+                        'GOODS_ID' => $goods['ID'],
+                        'PRICE' => $goods['SELL_PRICE'],
+                        'PV' => $goods['PRICE_PV'],
+                        'REAL_PRICE' => $realPrice,
+                        'REAL_PV' => $realPv,
+                        'POINT' => $goods['POINT'],
+                        'BUY_NUMS' => intval($v),
+                        'SKU_CODE' => $goods['GOODS_NO'],
+                        'GOODS_TITLE' => $goods['GOODS_NAME']
+                    ];
+                }
+            }
+        }
+        $this->_decAmount = $totalAmount;
+        $this->_decPv = $totalPv;
+        $this->_freight = ($totalAmount>=300) ? 0 : 15;
+        $this->_payAmount = $this->_decAmount + $this->_freight;
+
+        $db = \Yii::$app->db;
+        $transaction = $db->beginTransaction();
+        try {
+            $loginUserId = \Yii::$app->user->id;
+
+            //是否开启伞下会员限制
+            $isResaleUmbrella = Cache::getSystemConfig()['isResaleUmbrella']['VALUE'];
+            if($isResaleUmbrella){
+                $userId = Info::getUserIdByUserName($this->userName);
+                $userNetwork = UserNetwork::find()->where("USER_ID=:USER_ID AND INSTR(PARENT_UIDS,'{$loginUserId}')>0", ['USER_ID'=>$userId])->count();
+                if(!$userNetwork){
+                    throw new Exception($this->userName.'不是您的伞下会员,不能为其复消!');
+                }
+            }
+            //判断用户余额是否充足
+            if($this->payType=='cash') {
+                if (Cash::getAvailableBalance($loginUserId) < $this->_payAmount) {
+                    throw new Exception('余额不足,无法购买商品');
+                }
+            }else{
+                if ($this->_payAmount > Balance::getBalanceReconsumePoints($loginUserId)) {
+                    throw new Exception('复消积分不足,无法购买商品');
+                }
+            }
+            //写入订单
+            if (!$orderResult = $this->addUserOrder()) {
+                throw new Exception(Form::formatErrorsForApi($orderResult->getErrors()));
+            }
+            $transaction->commit();
+        }catch (\Exception $e){
+            $transaction->rollBack();
+            $this->addError('add', $e->getMessage());
+            return null;
+        }
+        return true;
+    }
+
+    /**
+     * 帮会员复消的订单
+     */
+    public function addUserOrder(){
+        $periodObj = Period::instance();
+        $nowPeriodNum = $periodObj->getNowPeriodNum();
+        $nowCalcMonth = $periodObj->getYearMonth($nowPeriodNum);
+        //帮复消会员Id(登陆会员)
+        $loginUserId = \Yii::$app->user->id;
+        $loginUserName = Info::getUserNameByUserId($loginUserId);
+        //订单会员Id
+        $userId = Info::getUserIdByUserName($this->userName);
+
+        // 加入订单信息
+        $warehouse = Region::getWarehouseByCode($this->province);//仓库
+        if(!$warehouse){
+            throw new Exception('地区暂时不支持配送,具体联系客服');
+        }
+        $ordNo = $this->_generateSn();
+        $orderModel = new Order();
+        $orderModel->SN = 'OS'.$ordNo;
+        $orderModel->DEC_SN = 'DS'.$ordNo;
+        $orderModel->ORDER_TYPE = $this->type;
+        $orderModel->USER_ID = $userId;
+        $orderModel->USER_NAME = $this->userName;
+        $orderModel->ORDER_AMOUNT = $this->_decAmount;
+        $orderModel->PV = $this->_decPv;
+        $orderModel->PAY_AMOUNT = $this->_payAmount;
+        $orderModel->PAY_PV = $this->_decPv;
+        $orderModel->PAY_AT = Date::nowTime();
+        $orderModel->PAY_TYPE = $this->payType;
+        $orderModel->PERIOD_NUM = $nowPeriodNum;
+        $orderModel->P_CALC_MONTH = Date::ociToDate($nowCalcMonth, Date::OCI_TIME_FORMAT_SHORT_MONTH);
+        $orderModel->FREIGHT = $this->_freight;
+        $orderModel->PAY_FREIGHT = $this->_freight;
+        $orderModel->CONSIGNEE = $this->consignee;
+        $orderModel->MOBILE = $this->acceptMobile;
+        $orderModel->PROVINCE = $this->province;
+        $orderModel->CITY = $this->city;
+        $orderModel->COUNTY = $this->county;
+        $orderModel->ADDRESS = $this->detailaddress;
+        $orderModel->FRONT_REMARK = $this->remark;
+        $orderModel->WAREHOUSE = $warehouse;
+        $orderModel->STATUS = 1;
+        $orderModel->CREATED_AT = Date::nowTime();
+        $orderModel->CREATE_USER = $loginUserName;
+        if(!$orderModel->save()){
+            $this->addErrors($orderModel->getErrors());
+            return false;
+        }
+        // 加入商品到订单商品表
+        foreach($this->_orderGoods as $key=>$value){
+            $this->_orderGoods[$key]['ORDER_SN'] = $orderModel->SN;
+            $this->_orderGoods[$key]['P_CALC_MONTH'] = Date::ociToDate($nowCalcMonth, Date::OCI_TIME_FORMAT_SHORT_MONTH);
+        }
+        OrderGoods::batchInsert($this->_orderGoods);
+
+        //扣除会员余额/积分
+        if($this->payType=='cash') {
+            Cash::changeUserCash($loginUserId, 'CASH', -abs($this->_payAmount), ['REMARK' => '会员复销余额支付']);
+        }else{
+            Balance::changeUserBonus($loginUserId,'reconsume_points', -abs($this->_payAmount),['DEAL_TYPE_ID' => DealType::RECONSUME_POINTS_EXCHANGE, 'REMARK' => '会员复销积分兑换']);
+        }
+        return $orderModel;
+    }
+
+    /**
+     * 生成流水号
+     * @return string
+     */
+    private function _generateSn() {
+        return Date::today('Ymd') . $this->_random(10, 1);
+    }
+
+    /**
+     * 生成随机数
+     * @param $length
+     * @param int $numeric
+     * @return string
+     */
+    private function _random($length, $numeric = 0) {
+        $seed = base_convert(md5(microtime() . $_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
+        $seed = $numeric ? (str_replace('0', '', $seed) . '012340567890') : ($seed . 'zZ' . strtoupper($seed));
+        $hash = '';
+        $max = strlen($seed) - 1;
+        for ($i = 0; $i < $length; $i++) {
+            $hash .= $seed[mt_rand(0, $max)];
+        }
+        return $hash;
+    }
+}

+ 0 - 0
common/models/forms/PreparePeriodForm.php


+ 29 - 3
common/models/forms/TransferForm.php

@@ -33,10 +33,11 @@ use yii\helpers\Json;
  * Login form
  */
 class TransferForm extends Model {
-    const allowTransferType = [1, 2, 3];
+    const allowTransferType = [1, 2, 3, 4];
     const BONUS_TO_BALANCE = 1;
     const BONUS_TO_BONUS = 2;
     const BALANCE_TO_BALANCE = 3;
+    const POINT_TO_BALANCE = 4;
 
     public $toUserName;
     public $toRealName;
@@ -206,7 +207,9 @@ class TransferForm extends Model {
         // 获取当前用户的可用金额
         if( $this->type == self::BALANCE_TO_BALANCE ) {
             $haveBalance = Cash::getAvailableBalance($this->_fromUserInfo['ID']);
-        }else {
+        }else if ($this->type == self::POINT_TO_BALANCE) {
+            $haveBalance = Balance::getBalanceReconsumePoints($this->_fromUserInfo['ID']);
+        } else {
             $haveBalance = Balance::getAvailableBalance($this->_fromUserInfo['ID']);
         }
         if ($this->amount > $haveBalance) {
@@ -347,7 +350,30 @@ class TransferForm extends Model {
                 // 会员金额减少
                 Cash::changeUserCash($this->_fromUserInfo['ID'], 'CASH', -abs($this->amount), ['TRANSFER_SN' => $model->TRANSFER_SN,'DEAL_TYPE_ID' => DealType::TRANSFER_OUT, 'REMARK' => 'To:' . $this->_toUserInfo['USER_NAME'] . ',' . $this->remark]);
                 Cash::changeUserCash($this->_toUserInfo['ID'], 'CASH', abs($amount), ['TRANSFER_SN' => $model->TRANSFER_SN,'DEAL_TYPE_ID' => DealType::TRANSFER_IN, 'REMARK' => 'From:' . $this->_fromUserInfo['USER_NAME'] . ',' . $this->remark]);
-            }else {
+            } else if ($this->type == self::POINT_TO_BALANCE) {
+                // 复消积分转余额
+                // 减少复消积分
+                Balance::changeUserBonus(
+                    $this->_fromUserInfo['ID'], 
+                    'reconsume_points', 
+                    -abs($this->amount), 
+                    [
+                        'TRANSFER_SN' => $model->TRANSFER_SN, 
+                        'DEAL_TYPE_ID' => DealType::TRANSFER_OUT, 
+                        'REMARK' => 'To:' . $this->_toUserInfo['USER_NAME'] . ',' . $this->remark
+                    ]
+                );
+                // 增加余额
+                Cash::changeUserCash(
+                    $this->_toUserInfo['ID'], 
+                    'CASH', abs($amount), 
+                    [
+                        'TRANSFER_SN' => $model->TRANSFER_SN,
+                        'DEAL_TYPE_ID' => DealType::TRANSFER_IN, 
+                        'REMARK' => 'From:' . $this->_fromUserInfo['USER_NAME'] . ',' . $this->remark
+                    ]
+                );
+            } else {
                 throw new \Exception('错误的交易类型');
             }
 

+ 2 - 2
console/controllers/BonusController.php

@@ -254,12 +254,12 @@ class BonusController extends BaseController
     }
 
     /**
-     * 兑换积分流水导出
+     * 兑换点数流水导出
      * @param $taskId
      * @return bool
      */
     public function actionFlowExchangeExport($taskId){
-        return $this->_export($taskId, FlowExchangePointsList::class, '兑换积分流水列表');
+        return $this->_export($taskId, FlowExchangePointsList::class, '兑换点数流水列表');
     }
 
     /**

+ 4 - 4
frontendApi/modules/v1/controllers/BonusController.php

@@ -73,7 +73,7 @@ class BonusController extends BaseController {
         $wallet[] = ['walletType' => 'bonus', 'walletName' => '会员奖金', 'amount' => Tool::formatPrice($data['BONUS'])];
         $wallet[] = ['walletType' => 'cash', 'walletName' => '会员余额', 'amount' => Tool::formatPrice($data['CASH'])];
         $wallet[] = ['walletType' => 'point', 'walletName' => '会员积分', 'amount' => Tool::formatPrice($data['RECONSUME_POINTS'])];
-        $wallet[] = ['walletType' => 'exchange', 'walletName' => '兑换积分', 'amount' => Tool::formatPrice($data['EXCHANGE_POINTS'])];
+        $wallet[] = ['walletType' => 'exchange', 'walletName' => '兑换点数', 'amount' => Tool::formatPrice($data['EXCHANGE_POINTS'])];
 //        if ($showCFLX) {
 //            $wallet[] = ['walletType' => 'cf', 'walletName' => '福利积分一', 'amount' => Tool::formatPrice($data['CF'])];
 //            $wallet[] = ['walletType' => 'lx', 'walletName' => '福利积分二', 'amount' => Tool::formatPrice($data['LX'])];
@@ -339,7 +339,7 @@ class BonusController extends BaseController {
         if($detailSwitch) {
             $data[] = ['name' => '期数', 'value' => $periodNum];
             $data[] = ['name' => '级别', 'value' => Cache::getDecLevelConfig()[$calcBonus['LAST_DEC_LV']]['LEVEL_NAME']];
-            $data[] = ['name' => '荣誉', 'value' => Cache::getEmpLevelConfig()[$calcBonus['LAST_EMP_LV']]['LEVEL_NAME']];
+            $data[] = ['name' => '最新聘级', 'value' => Cache::getEmpLevelConfig()[$calcBonus['LAST_EMP_LV']]['LEVEL_NAME']];
             if ($sysConfig['openTG']['VALUE']) {
                 // 销售奖金 就是 原来的推广奖
                 $data[] = ['name' => '销售奖金', 'value' => Tool::formatPrice($calcBonus['ORI_BONUS_TG'])];
@@ -361,7 +361,7 @@ class BonusController extends BaseController {
             $data[] = ['name' => '管理费', 'value' => Tool::formatPrice($calcBonus['MANAGE_TAX'])];
             $data[] = ['name' => '实发奖金', 'value' => Tool::formatPrice($calcBonus['BONUS_REAL'])];
             $data[] = ['name' => '复消积分', 'value' => Tool::formatPrice($calcBonus['RECONSUME_POINTS'])];
-            $data[] = ['name' => '兑换积分', 'value' => Tool::formatPrice($calcBonus['EXCHANGE_POINTS'])];
+            $data[] = ['name' => '兑换点数', 'value' => Tool::formatPrice($calcBonus['EXCHANGE_POINTS'])];
             $data[] = ['name' => '一市场新增业绩', 'value' => Tool::formatFrontPerf($calcBonus['PV_1L'])];
             $data[] = ['name' => '二市场新增业绩', 'value' => Tool::formatFrontPerf($calcBonus['PV_2L'])];
             $data[] = ['name' => '三市场新增业绩', 'value' => Tool::formatFrontPerf($calcBonus['PV_3L'])];
@@ -469,7 +469,7 @@ class BonusController extends BaseController {
                 // 总奖金
                 $calcBonus[$key]['BONUS_TOTAL'] = ['name' => '总奖金', 'value' => Tool::formatPrice($calcBonus[$key]['BONUS_TOTAL'])];
                 $calcBonus[$key]['RECONSUME_POINTS'] = ['name' => '复销积分', 'value' => Tool::formatPrice($calcBonus[$key]['RECONSUME_POINTS'])];
-                $calcBonus[$key]['EXCHANGE_POINTS'] = ['name' => '兑换积分', 'value' => Tool::formatPrice($calcBonus[$key]['EXCHANGE_POINTS'])];
+                $calcBonus[$key]['EXCHANGE_POINTS'] = ['name' => '兑换点数', 'value' => Tool::formatPrice($calcBonus[$key]['EXCHANGE_POINTS'])];
                 $calcBonus[$key]['MANAGE_TAX'] = ['name' => '管理费', 'value' => Tool::formatPrice($calcBonus[$key]['MANAGE_TAX'])];
                 $calcBonus[$key]['BONUS_REAL'] = ['name' => '实发奖金', 'value' => Tool::formatPrice($calcBonus[$key]['BONUS_REAL'])];
                 // if ($sysConfig['openYC']['VALUE']) {

+ 1 - 0
frontendApi/modules/v1/controllers/FinanceController.php

@@ -302,6 +302,7 @@ class FinanceController extends BaseController {
     public function actionAvailableBalance() {
         $data['bonus'] = Balance::getAvailableBalance(\Yii::$app->user->id);
         $data['cash'] = Cash::getAvailableBalance(\Yii::$app->user->id);
+        $data['point'] = Balance::getBalanceReconsumePoints(\Yii::$app->user->id);
         return static::notice($data);
     }
 

+ 236 - 235
frontendApi/modules/v1/controllers/ShopController.php

@@ -1,236 +1,237 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: leo
- * Date: 2018/2/24
- * Time: 下午12:48
- */
-
-namespace frontendApi\modules\v1\controllers;
-
-use common\helpers\Date;
-use common\helpers\Form;
-use common\helpers\user\Info;
-use common\models\DecOrder;
-use common\models\forms\DeclarationForm;
-use common\models\forms\OrderForm;
-use common\models\Order;
-use common\models\ReceiveAddress;
-use common\models\Region;
-use common\models\ShopGoods;
-use common\models\User;
-use common\models\UserBonus;
-use common\models\UserWallet;
-
-class ShopController extends BaseController {
-    public $modelClass = DecOrder::class;
-
-    /**
-     * 商品列表
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionIndex() {
-        $condition = ' AND STATUS=1 AND (FIND_IN_SET(2,GIFT_TYPE)>0';
-        $isStudio = User::getEnCodeInfo(\Yii::$app->user->id)['IS_STUDIO'];
-        if($isStudio==1){
-            $condition.= " OR FIND_IN_SET(4,GIFT_TYPE)>0";
-        }
-        $condition.=")";
-
-        $data = ShopGoods::lists($condition, [], [
-            'orderBy' => 'SORT ASC,CREATED_AT DESC',
-            'from' => ShopGoods::tableName(),
-        ]);
-        foreach ($data['list'] as $key => $value) {
-            if ($value['TYPE'] == 1 || $value['TYPE'] == 2) {
-                $data['list'][$key]['DISCOUNT'] = ShopGoods::GOODS_TYPE[$value['TYPE']]['discount'];
-            } else {
-                $data['list'][$key]['DISCOUNT'] = $value['SELL_DISCOUNT']*100;
-            }
-            // $data['list'][$key]['DISCOUNT'] = ShopGoods::GOODS_TYPE[$value['TYPE']]['discount'];
-        }
-        return static::notice($data);
-    }
-
-    /**
-     * 获取商品详情
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionGoodsDetail(){
-        $id = \Yii::$app->request->get('id');
-        $data = null;
-        if($id){
-            $data = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1', [':ID'=>$id]);
-        }
-        return static::notice($data);
-    }
-
-    /**
-     * 购物车订单展示
-     * @throws \yii\web\HttpException
-     */
-    public function actionShowCart(){
-        $userId = \Yii::$app->user->id;
-        $payList = ShopGoods::payTypes();
-        $allAddress = ReceiveAddress::findAllAsArray('USER_ID=:USER_ID', [':USER_ID'=>$userId]);
-        if($allAddress) {
-            foreach ($allAddress as $key => $row) {
-                $allAddress[$key]['PROVINCE_NAME'] = Region::getCnName($row['PROVINCE']);
-                $allAddress[$key]['CITY_NAME'] = Region::getCnName($row['CITY']);
-                $allAddress[$key]['COUNTY_NAME'] = Region::getCnName($row['COUNTY']);
-            }
-        }
-        $userBalance = [
-            'points' => 0,
-            'cash' => 0,
-            'exchange' => 0
-        ];
-        if ($userBonusResult = UserBonus::findOneAsArray(['USER_ID' => $userId])) {
-            $userBalance['points'] = $userBonusResult['RECONSUME_POINTS'];
-            $userBalance['exchange'] = $userBonusResult['EXCHANGE_POINTS'];
-        }
-        if ($userCashResult = UserWallet::findOneAsArray(['USER_ID' => $userId])) {
-            $userBalance['cash'] = $userCashResult['CASH'];
-        }
-        return static::notice(['payList'=>$payList,'allAddress'=>$allAddress,'userBalance'=>$userBalance]);
-    }
-
-    /**
-     * 确认订单
-     */
-    public function actionSureOrder(){
-        if (\Yii::$app->request->isPost) {
-            $formModel = new OrderForm();
-            $formModel->scenario = 'userOrder';
-            $formModel->remark = '复销备注';
-            $post = \Yii::$app->request->post();
-            $post['type'] = DeclarationForm::TYPE_FX;
-            if ($formModel->load($post, '') && $formModel->add()) {
-                return static::notice('购物成功');
-            } else {
-                return static::notice(Form::formatErrorsForApi($formModel->getErrors()),400);
-            }
-        }
-    }
-
-    /**
-     * 订单支付成功
-     * @throws \yii\web\HttpException
-     */
-    public function actionPaySuccess(){
-        $orderSn = \Yii::$app->request->get('orderSn');
-        $data = null;
-        if($orderSn){
-            $data = Order::findOneAsArray('SN=:SN', [':SN'=>$orderSn]);
-        }
-        return static::notice($data);
-    }
-
-    /**
-     * 我的报单
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionDecOrderList() {
-        $condition = ' AND USER_ID=:USER_ID AND IS_DEL=0';
-        $params[':USER_ID'] = \Yii::$app->user->id;
-        $data = DecOrder::lists($condition, $params, [
-            'select' => 'DO.*,U.USER_NAME USER_NAME,U.REAL_NAME REAL_NAME,RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME',
-            'orderBy' => 'DO.CREATED_AT DESC',
-            'from' => DecOrder::tableName() . ' AS DO',
-            'join' => [
-                ['LEFT JOIN', User::tableName() . ' AS U', 'DO.TO_USER_ID=U.ID'],
-                ['LEFT JOIN', User::tableName() . ' AS RU', 'DO.REC_USER_ID=RU.ID'],
-                ['LEFT JOIN', User::tableName() . ' AS CU', 'DO.CON_USER_ID=CU.ID'],
-            ],
-        ]);
-        return static::notice($data);
-    }
-
-    /**
-     * 我的订单
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionOrderList() {
-        $uname = Info::getUserNameByUserId(\Yii::$app->user->id);
-        $condition = " AND ORDER_TYPE='FX' AND (USER_ID=:USER_ID OR CREATE_USER='$uname')";
-        $params[':USER_ID'] = \Yii::$app->user->id;
-        $data = Order::lists($condition, $params, [
-            'select' => 'O.*,U.REAL_NAME',
-            'orderBy' => 'O.CREATED_AT DESC',
-            'from' => Order::tableName() . ' AS O',
-            'join' => [
-                ['LEFT JOIN', User::tableName() . ' AS U', 'U.ID=O.USER_ID'],
-            ],
-        ]);
-        foreach ($data['list'] as $key => $value) {
-            //$data['list'][$key]['PROVINCE_NAME'] = $value['PROVINCE'] ? Region::getCnName($value['PROVINCE']) : '';
-           //$data['list'][$key]['CITY_NAME'] = $value['CITY'] ? Region::getCnName($value['CITY']) : '';
-            //$data['list'][$key]['COUNTY_NAME'] = $value['COUNTY'] ? Region::getCnName($value['COUNTY']) : '';
-            $data['list'][$key]['PAY_AT'] = Date::convert($value['PAY_AT'],'Y-m-d H:i:s');
-        }
-        return static::notice($data);
-    }
-
-    /**
-     * 会员复消
-     */
-    public function actionReconsume() {
-        $condition = ' AND STATUS=1 AND (FIND_IN_SET(2,GIFT_TYPE)>0 OR FIND_IN_SET(4,GIFT_TYPE)>0)';
-        $data = ShopGoods::lists($condition, [], [
-            'orderBy' => 'SORT ASC,CREATED_AT DESC',
-            'from' => ShopGoods::tableName(),
-        ]);
-        foreach ($data['list'] as $key => $value) {
-            if ($value['TYPE'] == 1 || $value['TYPE'] == 2) {
-                $data['list'][$key]['DISCOUNT'] = ShopGoods::GOODS_TYPE[$value['TYPE']]['discount'];
-            } else {
-                $data['list'][$key]['DISCOUNT'] = $value['SELL_DISCOUNT']*100;
-            }
-            //$data['list'][$key]['DISCOUNT'] = ShopGoods::GOODS_TYPE[$value['TYPE']]['discount'];
-        }
-        return static::notice($data);
-    }
-
-    /**
-     * 帮会员复消购物车
-     * @throws \yii\web\HttpException
-     */
-    public function actionReconsumeCart(){
-        $userId = \Yii::$app->user->id;
-        $payList = ['cash'=>['name'=>'余额支付'],];
-        $userBalance = [
-            'points' => 0,
-            'cash' => 0
-        ];
-        if ($userBonusResult = UserBonus::findOneAsArray(['USER_ID' => $userId])) {
-            $userBalance['points'] = $userBonusResult['RECONSUME_POINTS'];
-        }
-        if ($userCashResult = UserWallet::findOneAsArray(['USER_ID' => $userId])) {
-            $userBalance['cash'] = $userCashResult['CASH'];
-        }
-        return static::notice(['payList'=>$payList,'userBalance'=>$userBalance]);
-    }
-
-    /**
-     * 帮会员复消确认订单
-     */
-    public function actionReconsumeSureOrder(){
-        if (\Yii::$app->request->isPost) {
-            $formModel = new OrderForm();
-            $formModel->scenario = 'reconsumeOrder';
-            $formModel->remark = '帮会员复销';
-            $post = \Yii::$app->request->post();
-            $post['type'] = DeclarationForm::TYPE_FX;
-            if ($formModel->load($post, '') && $formModel->reconsumeAdd()) {
-                return static::notice('帮会员复消成功');
-            } else {
-                return static::notice(Form::formatErrorsForApi($formModel->getErrors()),400);
-            }
-        }
-    }
-
+<?php
+/**
+ * Created by PhpStorm.
+ * User: leo
+ * Date: 2018/2/24
+ * Time: 下午12:48
+ */
+
+namespace frontendApi\modules\v1\controllers;
+
+use common\helpers\Date;
+use common\helpers\Form;
+use common\helpers\user\Info;
+use common\models\DecOrder;
+use common\models\forms\DeclarationForm;
+use common\models\forms\OrderForm;
+use common\models\Order;
+use common\models\ReceiveAddress;
+use common\models\Region;
+use common\models\ShopGoods;
+use common\models\User;
+use common\models\UserBonus;
+use common\models\UserWallet;
+
+class ShopController extends BaseController {
+    public $modelClass = DecOrder::class;
+
+    /**
+     * 商品列表
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionIndex() {
+        $condition = ' AND STATUS=1 AND (FIND_IN_SET(2,GIFT_TYPE)>0';
+        $isStudio = User::getEnCodeInfo(\Yii::$app->user->id)['IS_STUDIO'];
+        if($isStudio==1){
+            $condition.= " OR FIND_IN_SET(4,GIFT_TYPE)>0";
+        }
+        $condition.=")";
+
+        $data = ShopGoods::lists($condition, [], [
+            'orderBy' => 'SORT ASC,CREATED_AT DESC',
+            'from' => ShopGoods::tableName(),
+        ]);
+        foreach ($data['list'] as $key => $value) {
+            if ($value['TYPE'] == 1 || $value['TYPE'] == 2) {
+                $data['list'][$key]['DISCOUNT'] = ShopGoods::GOODS_TYPE[$value['TYPE']]['discount'];
+            } else {
+                $data['list'][$key]['DISCOUNT'] = $value['SELL_DISCOUNT']*100;
+            }
+            // $data['list'][$key]['DISCOUNT'] = ShopGoods::GOODS_TYPE[$value['TYPE']]['discount'];
+        }
+        return static::notice($data);
+    }
+
+    /**
+     * 获取商品详情
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionGoodsDetail(){
+        $id = \Yii::$app->request->get('id');
+        $data = null;
+        if($id){
+            $data = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1', [':ID'=>$id]);
+        }
+        return static::notice($data);
+    }
+
+    /**
+     * 购物车订单展示
+     * @throws \yii\web\HttpException
+     */
+    public function actionShowCart(){
+        $userId = \Yii::$app->user->id;
+        $payList = ShopGoods::payTypes();
+        $allAddress = ReceiveAddress::findAllAsArray('USER_ID=:USER_ID', [':USER_ID'=>$userId]);
+        if($allAddress) {
+            foreach ($allAddress as $key => $row) {
+                $allAddress[$key]['PROVINCE_NAME'] = Region::getCnName($row['PROVINCE']);
+                $allAddress[$key]['CITY_NAME'] = Region::getCnName($row['CITY']);
+                $allAddress[$key]['COUNTY_NAME'] = Region::getCnName($row['COUNTY']);
+            }
+        }
+        $userBalance = [
+            'points' => 0,
+            'cash' => 0,
+            'exchange' => 0
+        ];
+        if ($userBonusResult = UserBonus::findOneAsArray(['USER_ID' => $userId])) {
+            $userBalance['points'] = $userBonusResult['RECONSUME_POINTS'];
+            $userBalance['exchange'] = $userBonusResult['EXCHANGE_POINTS'];
+        }
+        if ($userCashResult = UserWallet::findOneAsArray(['USER_ID' => $userId])) {
+            $userBalance['cash'] = $userCashResult['CASH'];
+        }
+        return static::notice(['payList'=>$payList,'allAddress'=>$allAddress,'userBalance'=>$userBalance]);
+    }
+
+    /**
+     * 确认订单
+     */
+    public function actionSureOrder(){
+        if (\Yii::$app->request->isPost) {
+            $formModel = new OrderForm();
+            $formModel->scenario = 'userOrder';
+            $formModel->remark = '复销备注';
+            $post = \Yii::$app->request->post();
+            $post['type'] = DeclarationForm::TYPE_FX;
+            if ($formModel->load($post, '') && $formModel->add()) {
+                return static::notice('购物成功');
+            } else {
+                return static::notice(Form::formatErrorsForApi($formModel->getErrors()),400);
+            }
+        }
+    }
+
+    /**
+     * 订单支付成功
+     * @throws \yii\web\HttpException
+     */
+    public function actionPaySuccess(){
+        $orderSn = \Yii::$app->request->get('orderSn');
+        $data = null;
+        if($orderSn){
+            $data = Order::findOneAsArray('SN=:SN', [':SN'=>$orderSn]);
+        }
+        return static::notice($data);
+    }
+
+    /**
+     * 我的报单
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionDecOrderList() {
+        $condition = ' AND USER_ID=:USER_ID AND IS_DEL=0';
+        $params[':USER_ID'] = \Yii::$app->user->id;
+        $data = DecOrder::lists($condition, $params, [
+            'select' => 'DO.*,U.USER_NAME USER_NAME,U.REAL_NAME REAL_NAME,RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME',
+            'orderBy' => 'DO.CREATED_AT DESC',
+            'from' => DecOrder::tableName() . ' AS DO',
+            'join' => [
+                ['LEFT JOIN', User::tableName() . ' AS U', 'DO.TO_USER_ID=U.ID'],
+                ['LEFT JOIN', User::tableName() . ' AS RU', 'DO.REC_USER_ID=RU.ID'],
+                ['LEFT JOIN', User::tableName() . ' AS CU', 'DO.CON_USER_ID=CU.ID'],
+            ],
+
+        ]);
+        return static::notice($data);
+    }
+
+    /**
+     * 我的订单
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionOrderList() {
+        $uname = Info::getUserNameByUserId(\Yii::$app->user->id);
+        $condition = " AND ORDER_TYPE='FX' AND (USER_ID=:USER_ID OR CREATE_USER='$uname')";
+        $params[':USER_ID'] = \Yii::$app->user->id;
+        $data = Order::lists($condition, $params, [
+            'select' => 'O.*,U.REAL_NAME',
+            'orderBy' => 'O.CREATED_AT DESC',
+            'from' => Order::tableName() . ' AS O',
+            'join' => [
+                ['LEFT JOIN', User::tableName() . ' AS U', 'U.ID=O.USER_ID'],
+            ],
+        ]);
+        foreach ($data['list'] as $key => $value) {
+            //$data['list'][$key]['PROVINCE_NAME'] = $value['PROVINCE'] ? Region::getCnName($value['PROVINCE']) : '';
+           //$data['list'][$key]['CITY_NAME'] = $value['CITY'] ? Region::getCnName($value['CITY']) : '';
+            //$data['list'][$key]['COUNTY_NAME'] = $value['COUNTY'] ? Region::getCnName($value['COUNTY']) : '';
+            $data['list'][$key]['PAY_AT'] = Date::convert($value['PAY_AT'],'Y-m-d H:i:s');
+        }
+        return static::notice($data);
+    }
+
+    /**
+     * 会员复消
+     */
+    public function actionReconsume() {
+        $condition = ' AND STATUS=1 AND (FIND_IN_SET(2,GIFT_TYPE)>0 OR FIND_IN_SET(4,GIFT_TYPE)>0)';
+        $data = ShopGoods::lists($condition, [], [
+            'orderBy' => 'SORT ASC,CREATED_AT DESC',
+            'from' => ShopGoods::tableName(),
+        ]);
+        foreach ($data['list'] as $key => $value) {
+            if ($value['TYPE'] == 1 || $value['TYPE'] == 2) {
+                $data['list'][$key]['DISCOUNT'] = ShopGoods::GOODS_TYPE[$value['TYPE']]['discount'];
+            } else {
+                $data['list'][$key]['DISCOUNT'] = $value['SELL_DISCOUNT']*100;
+            }
+            //$data['list'][$key]['DISCOUNT'] = ShopGoods::GOODS_TYPE[$value['TYPE']]['discount'];
+        }
+        return static::notice($data);
+    }
+
+    /**
+     * 帮会员复消购物车
+     * @throws \yii\web\HttpException
+     */
+    public function actionReconsumeCart(){
+        $userId = \Yii::$app->user->id;
+        $payList = ['cash'=>['name'=>'余额支付'],];
+        $userBalance = [
+            'points' => 0,
+            'cash' => 0
+        ];
+        if ($userBonusResult = UserBonus::findOneAsArray(['USER_ID' => $userId])) {
+            $userBalance['points'] = $userBonusResult['RECONSUME_POINTS'];
+        }
+        if ($userCashResult = UserWallet::findOneAsArray(['USER_ID' => $userId])) {
+            $userBalance['cash'] = $userCashResult['CASH'];
+        }
+        return static::notice(['payList'=>$payList,'userBalance'=>$userBalance]);
+    }
+
+    /**
+     * 帮会员复消确认订单
+     */
+    public function actionReconsumeSureOrder(){
+        if (\Yii::$app->request->isPost) {
+            $formModel = new OrderForm();
+            $formModel->scenario = 'reconsumeOrder';
+            $formModel->remark = '帮会员复销';
+            $post = \Yii::$app->request->post();
+            $post['type'] = DeclarationForm::TYPE_FX;
+            if ($formModel->load($post, '') && $formModel->reconsumeAdd()) {
+                return static::notice('帮会员复消成功');
+            } else {
+                return static::notice(Form::formatErrorsForApi($formModel->getErrors()),400);
+            }
+        }
+    }
+
 }

+ 2 - 1
frontendEle/src/views/bonus/index.vue

@@ -121,6 +121,7 @@
         let vueObj = this
         vueObj.loading = true
         network.getData('bonus/index').then(response => {
+          console.log(response.wallet);
           vueObj.walletData = response.wallet
           vueObj.dealSwitch = response.dealSwitch
           vueObj.loading = false
@@ -207,4 +208,4 @@
 <style>
   .dialog-footer:after{content: '';
     clear: both;display: table;}
-</style>
+</style>

+ 48 - 47
frontendEle/src/views/bonus/new.vue

@@ -1,48 +1,49 @@
-<template>
-  <div v-loading="loading">
-    <div class="bonus-list">
-      <div class="bonus-item" v-for="(item,key) in newData" :key="key">
-        <el-tooltip effect="dark" :content="item.name" placement="top-end">
-          <div>{{item.value}}</div>
-        </el-tooltip>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-  import network from '@/utils/network'
-  import tool from '@/utils/tool'
-
-  export default {
-    name: 'bonus_new',
-    components: {},
-    mounted() {
-      this.getData()
-    },
-    data() {
-      return {
-        loading:false,
-        newData:null
-      }
-    },
-    methods: {
-      getData() {
-        let vueObj = this
-        vueObj.loading = true
+<template>
+  <div v-loading="loading">
+    <div class="bonus-list">
+      <div class="bonus-item" v-for="(item,key) in newData" :key="key">
+        <el-tooltip effect="dark" :content="item.name" placement="top-end">
+          <div>{{item.value}}</div>
+        </el-tooltip>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import network from '@/utils/network'
+  import tool from '@/utils/tool'
+
+  export default {
+    name: 'bonus_new',
+    components: {},
+    mounted() {
+      this.getData()
+    },
+    data() {
+      return {
+        loading:false,
+        newData:null
+      }
+    },
+    methods: {
+      getData() {
+        let vueObj = this
+        vueObj.loading = true
         network.getData('bonus/new').then(response => {
-          vueObj.newData = response
-          vueObj.loading = false
-        }).catch(response => {
-          vueObj.loading = false
-        })
-      },
-    }
-  }
-
-</script>
-<style>
-  .bonus-list:after{content: '';clear: both;display: table;}
-  .bonus-list .bonus-item{float: left;width: 33.333%;text-align: center;background: #fff;height:36px;line-height:36px;border: 1px solid #ddd;margin: -1px 0 0 -1px;box-sizing: border-box;}
-  .bonus-list .bonus-item:hover{background: #f5f5f5;cursor: pointer;}
-</style>
+          //console.log(response);
+          vueObj.newData = response
+          vueObj.loading = false
+        }).catch(response => {
+          vueObj.loading = false
+        })
+      },
+    }
+  }
+
+</script>
+<style>
+  .bonus-list:after{content: '';clear: both;display: table;}
+  .bonus-list .bonus-item{float: left;width: 33.333%;text-align: center;background: #fff;height:36px;line-height:36px;border: 1px solid #ddd;margin: -1px 0 0 -1px;box-sizing: border-box;}
+  .bonus-list .bonus-item:hover{background: #f5f5f5;cursor: pointer;}
+</style>

+ 101 - 99
frontendEle/src/views/bonus/other.vue

@@ -1,101 +1,103 @@
-<template>
-  <div v-loading="loading">
-    <div class="white-box">
-      <el-table class="table-box other-table-box" :data="tableData" style="width: 100%;">
-        <el-table-column v-for="(item,key) in tableKey" :key="key">
-          <template slot-scope="scope">
-            <el-tooltip effect="dark" :content="scope.row[item].name" placement="top">
-            <div class="bonus-item">{{scope.row[item].value}}</div>
-            </el-tooltip>
-          </template>
-        </el-table-column>
-
-        <el-table-column >
-          <template slot-scope="scope">
-            <el-button type="primary" size="small" @click.native="showFlow(scope.row.PERIOD_NUM.value)">查看全部</el-button>
-          </template>
-        </el-table-column>
-
-      </el-table>
-    </div>
-    <el-dialog :title="`${periodNum}期奖金`" :visible.sync="dialogFlowVisible" width="80%">
-      <div class="bonus-list" v-loading="dialogLoading">
-        <div class="bonus-item" v-for="(item,key) in newData" :key="key">
-          <el-tooltip effect="dark" :content="item.name" placement="top-end">
-            <div>{{item.value}}</div>
-          </el-tooltip>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-  import network from '@/utils/network'
-  import tool from '@/utils/tool'
-
-  export default {
-    name: 'bonus_other',
-    components: {},
-    mounted() {
-      this.getData()
-    },
-    data() {
-      return {
-        allData: null,
-        tableKey: null,
-        newData: null,
-        loading: true,
-        tableData: null,
-        dialogFlowVisible:false,
-        periodNum: '',
-        dialogLoading: false,
-        tool: tool,
-      }
-    },
-    methods: {
-      getData() {
-        let vueObj = this
-        vueObj.loading = true
+<template>
+  <div v-loading="loading">
+    <div class="white-box">
+      <el-table class="table-box other-table-box" :data="tableData" style="width: 100%;">
+        <el-table-column v-for="(item,key) in tableKey" :key="key">
+          <template slot-scope="scope">
+            <el-tooltip effect="dark" :content="scope.row[item].name" placement="top">
+            <div class="bonus-item">{{scope.row[item].value}}</div>
+            </el-tooltip>
+          </template>
+        </el-table-column>
+
+        <el-table-column >
+          <template slot-scope="scope">
+            <el-button type="primary" size="small" @click.native="showFlow(scope.row.PERIOD_NUM.value)">查看全部</el-button>
+          </template>
+        </el-table-column>
+
+      </el-table>
+    </div>
+    <el-dialog :title="`${periodNum}期奖金`" :visible.sync="dialogFlowVisible" width="80%">
+      <div class="bonus-list" v-loading="dialogLoading">
+        <div class="bonus-item" v-for="(item,key) in newData" :key="key">
+          <el-tooltip effect="dark" :content="item.name" placement="top-end">
+            <div>{{item.value}}</div>
+          </el-tooltip>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import network from '@/utils/network'
+  import tool from '@/utils/tool'
+
+  export default {
+    name: 'bonus_other',
+    components: {},
+    mounted() {
+      this.getData()
+    },
+    data() {
+      return {
+        allData: null,
+        tableKey: null,
+        newData: null,
+        loading: true,
+        tableData: null,
+        dialogFlowVisible:false,
+        periodNum: '',
+        dialogLoading: false,
+        tool: tool,
+      }
+    },
+    methods: {
+      getData() {
+        let vueObj = this
+        vueObj.loading = true
         network.getData('bonus/other').then(response => {
-          vueObj.tableData = response.tableData
-          vueObj.tableKey = response.tableKey
-          vueObj.loading = false
-        }).catch(response => {
-          vueObj.loading = false
-        })
-      },
-      showFlow(periodNum){
-        let vueObj = this
-        this.$message({
-          message: '正在获取数据',
-          type: 'info'
-        })
-        this.periodNum = periodNum
-        vueObj.dialogFlowVisible = true
-        vueObj.dialogLoading = true
-        this.getFlowData()
-      },
-      getFlowData() {
-        let vueObj = this
+          //console.log(response);
+          vueObj.tableData = response.tableData
+          vueObj.tableKey = response.tableKey
+          vueObj.loading = false
+        }).catch(response => {
+          vueObj.loading = false
+        })
+      },
+      showFlow(periodNum){
+        let vueObj = this
+        this.$message({
+          message: '正在获取数据',
+          type: 'info'
+        })
+        this.periodNum = periodNum
+        vueObj.dialogFlowVisible = true
+        vueObj.dialogLoading = true
+        this.getFlowData()
+      },
+      getFlowData() {
+        let vueObj = this
         network.getData('bonus/new',{periodNum: vueObj.periodNum}).then(response => {
-          vueObj.newData = response
-          vueObj.dialogLoading = false
-        }).catch(response => {
-          vueObj.dialogLoading = false
-        })
-      },
-
-    }
-  }
-
-</script>
-<style>
-  .other-table-box .el-table__header-wrapper{display: none;}
-  .other-table-box .el-table__body tr:hover>td{background-color: #fff!important;}
-  .other-table-box .el-table__body tr td:not(:last-child):hover{background-color: #f5f5f5!important;}
-  .bonus-list:after{content: '';clear: both;display: table;}
-  .bonus-list .bonus-item{float: left;width: 33.333%;background: #fff;height:36px;line-height:36px;border: 1px solid #ddd;margin: -1px 0 0 -1px;box-sizing: border-box;}
-  .bonus-item{text-align: center;}
-  .bonus-item:hover{background: #f5f5f5;cursor: pointer;}
-</style>
+          console.log(response);
+          vueObj.newData = response
+          vueObj.dialogLoading = false
+        }).catch(response => {
+          vueObj.dialogLoading = false
+        })
+      },
+
+    }
+  }
+
+</script>
+<style>
+  .other-table-box .el-table__header-wrapper{display: none;}
+  .other-table-box .el-table__body tr:hover>td{background-color: #fff!important;}
+  .other-table-box .el-table__body tr td:not(:last-child):hover{background-color: #f5f5f5!important;}
+  .bonus-list:after{content: '';clear: both;display: table;}
+  .bonus-list .bonus-item{float: left;width: 33.333%;background: #fff;height:36px;line-height:36px;border: 1px solid #ddd;margin: -1px 0 0 -1px;box-sizing: border-box;}
+  .bonus-item{text-align: center;}
+  .bonus-item:hover{background: #f5f5f5;cursor: pointer;}
+</style>

+ 0 - 0
frontendEle/src/views/bonus/teams.vue


+ 253 - 252
frontendEle/src/views/dashboard/index.vue

@@ -1,253 +1,254 @@
-<template>
-  <div v-loading="loading">
-    <div>
-      <div class="welcome" :style="getEmpBg(myEmpLv['ICON_TYPE'])">
-        <h1>欢迎您,{{userName}}
-
-        <b v-if="verified==='0'" class="text-danger"> 您未实名认证,请登录商城系统完善会员资料并上传身份证</b>
-        </h1>
-        <el-row :gutter="0" class="wel-info">
-          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
-            <el-row :gutter="10">
-              <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="12">当前系统时间:{{nowDateTime}}</el-col>
-              <el-col :xs="24" :sm="24" :md="24" :lg="4" :xl="12">聘级:{{myEmpLv['LEVEL_NAME']!='无聘级'?myEmpLv['LEVEL_NAME']:''}}<span v-if="myEmpLv['ICON_TYPE']==0">无</span><img
-                  :src="getEmpIco(myEmpLv['ICON_TYPE'])" alt=""
-                  v-for="(o,key) in parseInt(myEmpLv['ICON_NUM'])"
-                  :key="key" v-if="myEmpLv['ICON_TYPE']>0">
-              </el-col>
-              <el-col :xs="24" :sm="24" :md="24" :lg="4" :xl="12">会员级别:{{decLvName}}</el-col>
-              <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="12">当前业绩期:{{periodNum}}</el-col>
-            </el-row>
-          </el-col>
-        </el-row>
-      </div>
-      <div style="display: none;">
-<!--        <el-button type="primary" @click="go('/config/base')">个人设置</el-button>-->
-        <el-button type="success" @click="go('/user/index')">个人资料</el-button>
-<!--        <el-button type="danger" @click="go('/user/rec-user')">开拓会员</el-button>-->
-        <el-button type="primary" @click="go('/finance/flow-bonus')">奖金流水</el-button>
-        <el-button type="warning" @click="go('/finance/withdraw')">提现明细</el-button>
-        <el-button type="success" @click="go('/finance/perf')">往期业绩</el-button>
-      </div>
-    </div>
-    <el-carousel trigger="click" :height="bannerHeight+'px'">
-      <el-carousel-item v-for="(item,key) in slides" :key="key">
-        <template v-if="item.TYPE==='1'">
-          <a :href="item.CONTENT" target="_blank" class="islide">
-            <img ref="bannerHeight" :src="item.IMAGE" alt="" @load="imgLoad">
-          </a>
-        </template>
-        <template v-else>
-          <router-link :to="`/article/detail/${item.CONTENT}`" target="_blank" class="islide"><img ref="bannerHeight" :src="item.IMAGE" alt="" @load="imgLoad"></router-link>
-        </template>
-      </el-carousel-item>
-    </el-carousel>
-
-    <el-row :gutter="10" class="news-c">
-      <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8" v-for="(item,key) in news" :key="key">
-        <el-card class="box-card">
-          <div slot="header" class="clearfix">
-            <span>{{item.CATE_NAME}}</span>
-            <el-button type="text" class="box-card-more">
-              <router-link :to="`/article/list/${item.ID}`">more+</router-link>
-            </el-button>
-          </div>
-          <div v-for="(o,k) in item.LISTS" :key="k" class="text item" v-if="item.LISTS.length>0">
-            <router-link :to="`/article/detail/${o.ID}`" :title="o.TITLE">{{sub_str(o.TITLE)}}</router-link>
-            <span>{{tool.formatDate(o.CREATED_AT,false)}}</span>
-          </div>
-          <div v-if="item.LISTS.length==0">暂无内容</div>
-        </el-card>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-  import network from '@/utils/network'
-  import tool from '@/utils/tool'
-  import baseInfo from '@/utils/baseInfo'
-  import userInfo from '@/utils/userInfo'
-  import countUp from 'vue-countup-v2'
-
-  export default {
-    name: 'dashboard_index',
-    components: {
-      countUp
-    },
-    mounted() {
+<template>
+  <div v-loading="loading">
+    <div>
+      <div class="welcome" :style="getEmpBg(myEmpLv['ICON_TYPE'])">
+        <h1>欢迎您,{{userName}}
+
+        <b v-if="verified==='0'" class="text-danger"> 您未实名认证,请登录商城系统完善会员资料并上传身份证</b>
+        </h1>
+        <el-row :gutter="0" class="wel-info">
+          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
+            <el-row :gutter="10">
+              <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="12">当前系统时间:{{nowDateTime}}</el-col>
+              <el-col :xs="24" :sm="24" :md="24" :lg="4" :xl="12">最高聘级:{{myEmpLv['LEVEL_NAME']!='无聘级'?myEmpLv['LEVEL_NAME']:''}}<span v-if="myEmpLv['ICON_TYPE']==0">无</span><img
+                  :src="getEmpIco(myEmpLv['ICON_TYPE'])" alt=""
+                  v-for="(o,key) in parseInt(myEmpLv['ICON_NUM'])"
+                  :key="key" v-if="myEmpLv['ICON_TYPE']>0">
+              </el-col>
+              <el-col :xs="24" :sm="24" :md="24" :lg="4" :xl="12">会员级别:{{decLvName}}</el-col>
+              <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="12">当前业绩期:{{periodNum}}</el-col>
+            </el-row>
+          </el-col>
+        </el-row>
+      </div>
+      <div style="display: none;">
+<!--        <el-button type="primary" @click="go('/config/base')">个人设置</el-button>-->
+        <el-button type="success" @click="go('/user/index')">个人资料</el-button>
+<!--        <el-button type="danger" @click="go('/user/rec-user')">开拓会员</el-button>-->
+        <el-button type="primary" @click="go('/finance/flow-bonus')">奖金流水</el-button>
+        <el-button type="warning" @click="go('/finance/withdraw')">提现明细</el-button>
+        <el-button type="success" @click="go('/finance/perf')">往期业绩</el-button>
+      </div>
+    </div>
+    <el-carousel trigger="click" :height="bannerHeight+'px'">
+      <el-carousel-item v-for="(item,key) in slides" :key="key">
+        <template v-if="item.TYPE==='1'">
+          <a :href="item.CONTENT" target="_blank" class="islide">
+            <img ref="bannerHeight" :src="item.IMAGE" alt="" @load="imgLoad">
+          </a>
+        </template>
+        <template v-else>
+          <router-link :to="`/article/detail/${item.CONTENT}`" target="_blank" class="islide"><img ref="bannerHeight" :src="item.IMAGE" alt="" @load="imgLoad"></router-link>
+        </template>
+      </el-carousel-item>
+    </el-carousel>
+
+    <el-row :gutter="10" class="news-c">
+      <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8" v-for="(item,key) in news" :key="key">
+        <el-card class="box-card">
+          <div slot="header" class="clearfix">
+            <span>{{item.CATE_NAME}}</span>
+            <el-button type="text" class="box-card-more">
+              <router-link :to="`/article/list/${item.ID}`">more+</router-link>
+            </el-button>
+          </div>
+          <div v-for="(o,k) in item.LISTS" :key="k" class="text item" v-if="item.LISTS.length>0">
+            <router-link :to="`/article/detail/${o.ID}`" :title="o.TITLE">{{sub_str(o.TITLE)}}</router-link>
+            <span>{{tool.formatDate(o.CREATED_AT,false)}}</span>
+          </div>
+          <div v-if="item.LISTS.length==0">暂无内容</div>
+        </el-card>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+  import network from '@/utils/network'
+  import tool from '@/utils/tool'
+  import baseInfo from '@/utils/baseInfo'
+  import userInfo from '@/utils/userInfo'
+  import countUp from 'vue-countup-v2'
+
+  export default {
+    name: 'dashboard_index',
+    components: {
+      countUp
+    },
+    mounted() {
       network.getData(`dashboard/index`).then(response => {
-        this.myEmpLv.ID = this.baseEmpLevels[response.empLv]['ID']
-        this.myEmpLv.LEVEL_NAME = this.baseEmpLevels[response.empLv]['LEVEL_NAME']
-        this.myEmpLv.ICON_TYPE = this.baseEmpLevels[response.empLv]['ICON_TYPE']
-        this.myEmpLv.ICON_NUM = this.baseEmpLevels[response.empLv]['ICON_NUM']
-        this.slides = response.slides
-        this.news = response.news
-        this.periodNum = response.periodNum
-        this.decLvName = response.decLvName
-        this.loading = false
-        this.imgLoad()
-        return network.getData(`dashboard/bonus-num`)
-      })
-      if(this.verified==='0'){
-        this.$confirm('您未实名认证,请登录商城系统完善会员资料并上传身份证', '请注意', {
-          confirmButtonText: '确定',
-          type: 'warning'
-        }).then(() => {
-        }).catch(() => {
-
-        })
-      }
-      this.calcTime()
-      window.addEventListener('resize', () => {
-        this.imgLoad()
-      }, false)
-    },
-    data() {
-      return {
-        loading: true,
-        tool: tool,
-        nowTime: tool.getTimestamp(),
-        userName: userInfo.userName(),
-        verified: userInfo.baseData().VERIFIED,
-        baseEmpLevels: baseInfo.empLevels(),
-        myEmpLv: {'ID': 0, 'LEVEL_NAME': null, 'ICON_TYPE': 0, 'ICON_NUM': 0},
-        slides: [],
-        news: [],
-        periodNum: '',
-        decLvName: '',
-        bannerHeight: '',
-      }
-    },
-    computed: {
-      nowDateTime: function () {
-        return tool.formatDate(this.nowTime)
-      }
-    },
-    methods: {
-      getEmpIco(type) {
-        if (type) return require('@/assets/emp-ico-' + type + '.png')
-      },
-      getEmpBg(type) {
-        if (type != 0) return 'backgroundImage:url(' + require('@/assets/emp-bg-' + type + '.png') + ')'
-      },
-      sub_str(str, len = 15) {
-        if (str) return str.slice(0, len)
-      },
-      calcTime() {
-        let obj = this
-        setInterval(function () {
-          obj.nowTime += 1
-        }, 1000)
-      },
-      go: function (url) {
-        this.$router.push(url)
-      },
-      imgLoad() {
-        let _this = this
-        _this.$nextTick(function () {
-          _this.bannerHeight = _this.$refs.bannerHeight[0].height
-        })
-      }
-    }
-  }
-</script>
-
-<style scoped>
-  h1 {
-    margin-top: 0
-  }
-
-  .welcome {
-    padding-bottom: 10px;
-    background-repeat: no-repeat;
-    background-position: right top;
-  }
-
-  .wel-info {
-    line-height: 36px;
-  }
-
-  .wel-info img {
-    vertical-align: middle;
-  }
-
-  .news-c .el-col .box-card {
-    margin-top: 10px;
-  }
-
-  .news-c .el-col:nth-child(3n+1) .box-card {
-    border-bottom: 4px solid #f34d14;
-  }
-
-  .news-c .el-col:nth-child(3n+2) .box-card {
-    border-bottom: 4px solid #27a2d3;
-  }
-
-  .news-c .el-col:nth-child(3n+3) .box-card {
-    border-bottom: 4px solid #1bbc61;
-  }
-
-  .box-card-more {
-    float: right;
-    padding: 3px 10px;
-    border: 1px solid #ddd;
-    border-radius: 10px;
-  }
-
-  .box-card-more a {
-    color: #666;
-  }
-
-  .box-card-more:hover {
-    border-color: #409EFF;
-  }
-
-  .box-card .item {
-    position: relative;
-    line-height: 30px;
-    padding-left: 10px;
-  }
-
-  .box-card .item:before {
-    content: '';
-    display: block;
-    width: 4px;
-    height: 4px;
-    background: #f60;
-    position: absolute;
-    left: 0px;
-    top: 14px;
-  }
-
-  .box-card .item:after {
-    content: '';
-    display: table;
-    clear: both;
-  }
-
-  .box-card .item a {
-    color: #333;
-    float: left;
-  }
-
-  .box-card .item a:hover {
-    color: #f60;
-  }
-
-  .box-card .item span {
-    float: right;
-    color: #999;
-    font-size: 12px;
-  }
-
-  .islide {
-    display: block;
-    text-align: center;
-  }
-
-  .islide img {
-    max-width: 100%;
-    max-height: 330px;
-  }
-</style>
+        console.log(response);
+        this.myEmpLv.ID = this.baseEmpLevels[response.empLv]['ID']
+        this.myEmpLv.LEVEL_NAME = this.baseEmpLevels[response.empLv]['LEVEL_NAME']
+        this.myEmpLv.ICON_TYPE = this.baseEmpLevels[response.empLv]['ICON_TYPE']
+        this.myEmpLv.ICON_NUM = this.baseEmpLevels[response.empLv]['ICON_NUM']
+        this.slides = response.slides
+        this.news = response.news
+        this.periodNum = response.periodNum
+        this.decLvName = response.decLvName
+        this.loading = false
+        this.imgLoad()
+        return network.getData(`dashboard/bonus-num`)
+      })
+      if(this.verified==='0'){
+        this.$confirm('您未实名认证,请登录商城系统完善会员资料并上传身份证', '请注意', {
+          confirmButtonText: '确定',
+          type: 'warning'
+        }).then(() => {
+        }).catch(() => {
+
+        })
+      }
+      this.calcTime()
+      window.addEventListener('resize', () => {
+        this.imgLoad()
+      }, false)
+    },
+    data() {
+      return {
+        loading: true,
+        tool: tool,
+        nowTime: tool.getTimestamp(),
+        userName: userInfo.userName(),
+        verified: userInfo.baseData().VERIFIED,
+        baseEmpLevels: baseInfo.empLevels(),
+        myEmpLv: {'ID': 0, 'LEVEL_NAME': null, 'ICON_TYPE': 0, 'ICON_NUM': 0},
+        slides: [],
+        news: [],
+        periodNum: '',
+        decLvName: '',
+        bannerHeight: '',
+      }
+    },
+    computed: {
+      nowDateTime: function () {
+        return tool.formatDate(this.nowTime)
+      }
+    },
+    methods: {
+      getEmpIco(type) {
+        if (type) return require('@/assets/emp-ico-' + type + '.png')
+      },
+      getEmpBg(type) {
+        if (type != 0) return 'backgroundImage:url(' + require('@/assets/emp-bg-' + type + '.png') + ')'
+      },
+      sub_str(str, len = 15) {
+        if (str) return str.slice(0, len)
+      },
+      calcTime() {
+        let obj = this
+        setInterval(function () {
+          obj.nowTime += 1
+        }, 1000)
+      },
+      go: function (url) {
+        this.$router.push(url)
+      },
+      imgLoad() {
+        let _this = this
+        _this.$nextTick(function () {
+          _this.bannerHeight = _this.$refs.bannerHeight[0].height
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+  h1 {
+    margin-top: 0
+  }
+
+  .welcome {
+    padding-bottom: 10px;
+    background-repeat: no-repeat;
+    background-position: right top;
+  }
+
+  .wel-info {
+    line-height: 36px;
+  }
+
+  .wel-info img {
+    vertical-align: middle;
+  }
+
+  .news-c .el-col .box-card {
+    margin-top: 10px;
+  }
+
+  .news-c .el-col:nth-child(3n+1) .box-card {
+    border-bottom: 4px solid #f34d14;
+  }
+
+  .news-c .el-col:nth-child(3n+2) .box-card {
+    border-bottom: 4px solid #27a2d3;
+  }
+
+  .news-c .el-col:nth-child(3n+3) .box-card {
+    border-bottom: 4px solid #1bbc61;
+  }
+
+  .box-card-more {
+    float: right;
+    padding: 3px 10px;
+    border: 1px solid #ddd;
+    border-radius: 10px;
+  }
+
+  .box-card-more a {
+    color: #666;
+  }
+
+  .box-card-more:hover {
+    border-color: #409EFF;
+  }
+
+  .box-card .item {
+    position: relative;
+    line-height: 30px;
+    padding-left: 10px;
+  }
+
+  .box-card .item:before {
+    content: '';
+    display: block;
+    width: 4px;
+    height: 4px;
+    background: #f60;
+    position: absolute;
+    left: 0px;
+    top: 14px;
+  }
+
+  .box-card .item:after {
+    content: '';
+    display: table;
+    clear: both;
+  }
+
+  .box-card .item a {
+    color: #333;
+    float: left;
+  }
+
+  .box-card .item a:hover {
+    color: #f60;
+  }
+
+  .box-card .item span {
+    float: right;
+    color: #999;
+    font-size: 12px;
+  }
+
+  .islide {
+    display: block;
+    text-align: center;
+  }
+
+  .islide img {
+    max-width: 100%;
+    max-height: 330px;
+  }
+</style>

+ 11 - 4
frontendEle/src/views/finance/transfer-add.vue

@@ -13,6 +13,9 @@
         <el-form-item label="当前可用余额">
           <el-tag type="success">{{cash}}元</el-tag>
         </el-form-item>
+        <el-form-item label="当前可用复消积分">
+          <el-tag type="success">{{point}}元</el-tag>
+        </el-form-item>
         <el-form-item label="当前转账比例" v-if="false">
           <el-tag type="info">{{transferProp}}%</el-tag>
         </el-form-item>
@@ -28,9 +31,10 @@
         <!--<el-form-item label="转入会员姓名">-->
           <!--<el-input v-model="form.toRealName"></el-input>-->
         <!--</el-form-item>-->
-        <el-form-item label="转账金额" style="margin-bottom: 0;">
+        <el-form-item label="转账金额">
           <el-input v-model="form.amount" type="number" :max="maxAmount" @change="chkReal"></el-input>
-          <span style="font-size: 8pt;color: #909399;">每次转账不得少于100</span>
+          <!--<span style="font-size: 8pt;color: #909399;">每次转账不得少于100</span>-->
+          <span></span>
         </el-form-item>
         <el-form-item label="手续费" v-show="fee!=='0'">
           <el-tag type="info">{{fee}}%</el-tag>
@@ -62,7 +66,7 @@ export default {
   },
   data () {
     return {
-      allWallet:{'bonus':'会员账户','cash':'现金钱包'},
+      allWallet:{'bonus':'会员账户','cash':'现金钱包','point':'复消积分'},
       form: {
         type:1,
         toUserName: '',
@@ -77,6 +81,7 @@ export default {
       },
       balance: 0,
       cash: 0,
+      point:0,
       maxAmount: 0,
       fee: '0',
       realAmount: 0,
@@ -111,6 +116,7 @@ export default {
     },
     chkTransferUserinfo(){
       network.getData(`finance/chk-transfer-user`).then(response => {
+        console.log(response);
         this.loading = false
         this.userInfo = response.userInfo
         this.transferConfig = response.transferConfig
@@ -129,6 +135,7 @@ export default {
         this.$message.closeAll()
         this.balance = response.bonus
         this.cash = response.cash
+        this.point = response.point
         this.getMaxAmount()
         this.loading = false
       })
@@ -187,4 +194,4 @@ export default {
 
 <style scoped>
 
-</style>
+</style>

+ 91 - 89
frontendEle/src/views/shop/dec-order-list.vue

@@ -1,91 +1,93 @@
-<template>
-    <div v-loading="loading">
+<template>
+    <div v-loading="loading">
         <div class="white-box">
+          
             <el-table class="withdraw-table" :data="tableData" stripe style="width: 100%;">
-                <el-table-column label="创建时间">
-                    <template slot-scope="scope">
-                        {{tool.formatDate(scope.row.CREATED_AT)}}
-                    </template>
-                </el-table-column>
-                <el-table-column label="报单编号" prop="DEC_SN">
-
-                </el-table-column>
-                <el-table-column label="订单编号" prop="DEC_SN">
-
-                </el-table-column>
-
-                <el-table-column label="会员编号" prop="USER_NAME">
-                </el-table-column>
-                <el-table-column label="会员姓名" prop="REAL_NAME">
-                </el-table-column>
-                <!--<el-table-column label="推荐人编号" prop="REC_USER_NAME">-->
-                <!--</el-table-column>-->
-                <el-table-column label="接点人编号" prop="CON_USER_NAME">
-                </el-table-column>
-                <el-table-column label="报单金额" prop="DEC_AMOUNT">
-                </el-table-column>
-                <el-table-column label="报单PV" prop="DEC_PV">
-                </el-table-column>
-            </el-table>
-            <div class="white-box-footer">
-                <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script>
-    import network from '@/utils/network'
-    import tool from '@/utils/tool'
-    import Pagination from '@/components/Pagination'
-    export default {
-        name: "dec-order-list",
-        components: {Pagination},
-        mounted() {
-            this.getData()
-        },
-        data() {
-            return {
-                loading: false,
-                form:{
-
-                },
-                tableData:null,
-                list: null,
-                currentPage: 1,
-                totalPages: 1,
-                totalCount: 1,
-                pageSize: 20,
-                tool: tool,
-            }
-        },
-        methods: {
-            handleCurrentChange (page) {
-                this.getData(page, this.pageSize)
-            },
-            handleSizeChange (pageSize) {
-                this.getData(this.currentPage, pageSize)
-            },
-            getData(page, pageSize) {
-                network.getPageData(this, 'shop/dec-order-list', page, pageSize, {type: this.type}, function (response) {
-                //network.getData(`shop/dec-order-list`).then(response => {
-                    console.log(response)
-                    this.loading = false;
-                    this.list = response.list;
-                    let settingObj=this.list;
-                    let settingArr = Object.keys(settingObj).map(key => {
-                        //console.log(key); //为每个键名
-                        return settingObj[key];  //把每个对象返回出去生成一个新的数组中相当于0:{id:1}
-                    } );
-                    this.tableData=settingArr;
-                    console.log(this.tableData)
-
-                });
-            },
-        }
-    }
-</script>
-
-<style scoped>
-
-</style>
+
+                <el-table-column label="创建时间">
+                    <template slot-scope="scope">
+                        {{tool.formatDate(scope.row.CREATED_AT)}}
+                    </template>
+                </el-table-column>
+                <el-table-column label="报单编号" prop="DEC_SN">
+
+                </el-table-column>
+                <el-table-column label="订单编号" prop="ORDER_SN">
+
+                </el-table-column>
+
+                <el-table-column label="会员编号" prop="USER_NAME">
+                </el-table-column>
+                <el-table-column label="会员姓名" prop="REAL_NAME">
+                </el-table-column>
+                <!--<el-table-column label="推荐人编号" prop="REC_USER_NAME">-->
+                <!--</el-table-column>-->
+                <el-table-column label="接点人编号" prop="CON_USER_NAME">
+                </el-table-column>
+                <el-table-column label="报单金额" prop="DEC_AMOUNT">
+                </el-table-column>
+                <el-table-column label="报单PV" prop="DEC_PV">
+                </el-table-column>
+            </el-table>
+            <div class="white-box-footer">
+                <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+    import network from '@/utils/network'
+    import tool from '@/utils/tool'
+    import Pagination from '@/components/Pagination'
+    export default {
+        name: "dec-order-list",
+        components: {Pagination},
+        mounted() {
+            this.getData()
+        },
+        data() {
+            return {
+                loading: false,
+                form:{
+
+                },
+                tableData:null,
+                list: null,
+                currentPage: 1,
+                totalPages: 1,
+                totalCount: 1,
+                pageSize: 20,
+                tool: tool,
+            }
+        },
+        methods: {
+            handleCurrentChange (page) {
+                this.getData(page, this.pageSize)
+            },
+            handleSizeChange (pageSize) {
+                this.getData(this.currentPage, pageSize)
+            },
+            getData(page, pageSize) {
+                network.getPageData(this, 'shop/dec-order-list', page, pageSize, {type: this.type}, function (response) {
+                //network.getData(`shop/dec-order-list`).then(response => {
+                    console.log(response)
+                    this.loading = false;
+                    this.list = response.list;
+                    let settingObj=this.list;
+                    let settingArr = Object.keys(settingObj).map(key => {
+                        //console.log(key); //为每个键名
+                        return settingObj[key];  //把每个对象返回出去生成一个新的数组中相当于0:{id:1}
+                    } );
+                    this.tableData=settingArr;
+                    //console.log(this.tableData)
+
+                });
+            },
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
frontendEle/src/views/shop/order.vue

@@ -72,7 +72,7 @@
                         <div>¥{{balance.cash}}元</div>
                     </div>
                     <div class="sum_box">
-                        <div>无业绩兑换</div>
+                        <div>无业绩兑换点数</div>
                         <div>{{balance.exchange}}</div>
                     </div>
                 </div>

+ 125 - 125
mysql_db_yyj.sql

@@ -1,125 +1,125 @@
--- AR_SHOP_GOODS表结构修改
-ALTER TABLE `AR_SHOP_GOODS` ADD `IS_DEL` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否删除';
-ALTER TABLE `AR_SHOP_GOODS` ADD `DELETED_AT` INT(10) NOT NULL DEFAULT '0' COMMENT '删除时间';
-ALTER TABLE `AR_SHOP_GOODS` ADD `POINT` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '兑换积分';
-ALTER TABLE `AR_SHOP_GOODS` ADD `SELL_TYPE` VARCHAR(32) NOT NULL DEFAULT '1,2' COMMENT '出售方式';
-
--- AR_ORDER_GOODS表结构修改
-ALTER TABLE `AR_ORDER_GOODS` ADD `POINT` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '兑换积分';
-
--- AR_ORDER表结构修改
-ALTER TABLE `AR_ORDER` ADD `PAY_TYPE` VARCHAR(32) NOT NULL DEFAULT 'cash' COMMENT '支付方式';
-
--- 03-15更新表结构
-ALTER TABLE `AR_FLOW_WALLET`
-ADD COLUMN `TRANSFER_SN` varchar(32) DEFAULT NULL AFTER `SORT`;
-
-ALTER TABLE `AR_DECLARATION_PACKAGE`
-ADD COLUMN `PACKAGE_NO` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT 'PG546763' AFTER `PACKAGE_NAME`;
-
-ALTER TABLE `AR_ORDER`
-ADD COLUMN `WAREHOUSE` varchar(16) COLLATE utf8mb4_bin NOT NULL DEFAULT '01' AFTER `PAY_TYPE`;
-
-UPDATE AR_CONFIG SET VALUE='[{"out":"bonus","in":"cash","outMin":"100","outMax":"0","fee":"3","feeMin":"0","feeMax":"0","weekMax":"0","monthMax":"0","isSystem":true,"isBind":true,"isOpen":true},{"out":"bonus","in":"bonus","outMin":"100","outMax":"0","fee":"0","feeMin":"0","feeMax":"0","weekMax":"0","monthMax":"0","isSystem":true,"isBind":true,"isOpen":true},{"out":"cash","in":"cash","outMin":"100","outMax":"0","fee":"0","feeMin":"0","feeMax":"0","weekMax":"0","monthMax":"0","isSystem":true,"isBind":true,"isOpen":true}]' WHERE CONFIG_NAME='allowWallet';
-
--- ALTER TABLE `AR_USER_WALLET`
--- MODIFY COLUMN `CASH` decimal(16, 2) UNSIGNED NOT NULL DEFAULT 0.00 AFTER `USER_ID`;
--- ALTER TABLE `AR_USER_BONUS`
--- MODIFY COLUMN `BONUS` decimal(16, 2) UNSIGNED NOT NULL DEFAULT 0.00 AFTER `USER_ID`;
-
-
-DROP TABLE IF EXISTS `AR_TMP_OLD_NETWORK`;
-CREATE TABLE `AR_TMP_OLD_NETWORK` (
-  `ID` varchar(32) NOT NULL,
-  `USER_NAME` varchar(16) NOT NULL,
-  `REAL_NAME` varchar(128) NOT NULL,
-  `PARENT_USER_NAME` varchar(16) NOT NULL,
-  `PARENT_REAL_NAME` varchar(128) NOT NULL,
-  `NET_USER_NAME` varchar(16) NOT NULL,
-  `NET_REAL_NAME` varchar(128) NOT NULL,
-  `SORT` int(10) UNSIGNED NOT NULL DEFAULT '0',
-  `NET_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
-  `REC_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
-  PRIMARY KEY (`ID`),
-  KEY `USER_NAME` (`USER_NAME`) USING BTREE,
-  KEY `PARENT_USER_NAME` (`PARENT_USER_NAME`) USING BTREE,
-  KEY `NET_USER_NAME` (`NET_USER_NAME`) USING BTREE,
-  KEY `SORT` (`SORT`) USING BTREE,
-  KEY `NET_DEEP` (`NET_DEEP`) USING BTREE,
-  KEY `REC_DEEP` (`REC_DEEP`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='excel新增会员关系临时表';
-
-
-CREATE TABLE `AR_TMP_OLD_NETWORK_ALL` (
-  `ID` varchar(32) NOT NULL,
-  `USER_NAME` varchar(16) NOT NULL,
-  `REAL_NAME` varchar(128) NOT NULL,
-  `PARENT_USER_NAME` varchar(16) NOT NULL,
-  `PARENT_REAL_NAME` varchar(128) NOT NULL,
-  `NET_USER_NAME` varchar(16) NOT NULL,
-  `NET_REAL_NAME` varchar(128) NOT NULL,
-  `REC_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
-  `NET_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
-  `SORT` int(10) UNSIGNED NOT NULL DEFAULT '0',
-  `NET_SAME` tinyint(2) NOT NULL DEFAULT '0' COMMENT '相同0 不同1',
-  `REC_SAME` tinyint(2) NOT NULL DEFAULT '0',
-  `OLD_IS_EXSIT` tinyint(2) NOT NULL DEFAULT '0' COMMENT '0 不存在 1 存在',
-  PRIMARY KEY (`ID`),
-  KEY `USER_NAME` (`USER_NAME`) USING BTREE,
-  KEY `PARENT_USER_NAME` (`PARENT_USER_NAME`) USING BTREE,
-  KEY `NET_USER_NAME` (`NET_USER_NAME`) USING BTREE,
-  KEY `SORT` (`SORT`) USING BTREE,
-  KEY `NET_DEEP` (`NET_DEEP`) USING BTREE,
-  KEY `REC_DEEP` (`REC_DEEP`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='老系统总会员关系临时表';
-
-
-
-CREATE TABLE `AR_TMP_DELETE_USER` (
-  `ID` varchar(32) NOT NULL,
-  `USER_NAME` varchar(16) NOT NULL,
-  `REAL_NAME` varchar(128) NOT NULL,
-  `USER_ID` varchar(32) NOT NULL COMMENT '用户ID',
-  PRIMARY KEY (`ID`),
-  KEY `USER_ID` (`USER_ID`) USING BTREE,
-  KEY `USER_NAME` (`USER_NAME`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='线上会员多于34w的会员';
-
-
-
-CREATE TABLE `AR_TMP_OLD_NETWORK_ERROR` (
-  `ID` varchar(32) NOT NULL,
-  `USER_NAME` varchar(16) NOT NULL,
-  `REAL_NAME` varchar(128) NOT NULL,
-  `PARENT_USER_NAME` varchar(16) NOT NULL,
-  `PARENT_REAL_NAME` varchar(128) NOT NULL,
-  `NET_USER_NAME` varchar(16) NOT NULL,
-  `NET_REAL_NAME` varchar(128) NOT NULL,
-  `REC_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
-  `NET_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
-  `SORT` int(10) UNSIGNED NOT NULL DEFAULT '0',
-  PRIMARY KEY (`ID`),
-  KEY `USER_NAME` (`USER_NAME`) USING BTREE,
-  KEY `PARENT_USER_NAME` (`PARENT_USER_NAME`) USING BTREE,
-  KEY `NET_USER_NAME` (`NET_USER_NAME`) USING BTREE,
-  KEY `SORT` (`SORT`) USING BTREE,
-  KEY `NET_DEEP` (`NET_DEEP`) USING BTREE,
-  KEY `REC_DEEP` (`REC_DEEP`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='改错表';
-
-
-
-CREATE TABLE `AR_USER_REG` (
-  `ID` varchar(32) NOT NULL,
-  `USER_NAME` varchar(16) NOT NULL,
-  `REAL_NAME` varchar(128) NOT NULL,
-  `CON_UID` varchar(32) NOT NULL,
-  `REC_UID` varchar(32) NOT NULL,
-  `PARENT_USER_NAME` varchar(16) NOT NULL,
-  `PARENT_REAL_NAME` varchar(128) NOT NULL,
-  `NET_USER_NAME` varchar(16) NOT NULL,
-  `NET_REAL_NAME` varchar(128) NOT NULL,
-  PRIMARY KEY (`ID`),
-  KEY `USER_NAME` (`USER_NAME`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='正式站报单用户44';
-
+-- AR_SHOP_GOODS表结构修改
+ALTER TABLE `AR_SHOP_GOODS` ADD `IS_DEL` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否删除';
+ALTER TABLE `AR_SHOP_GOODS` ADD `DELETED_AT` INT(10) NOT NULL DEFAULT '0' COMMENT '删除时间';
+ALTER TABLE `AR_SHOP_GOODS` ADD `POINT` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '兑换点数';
+ALTER TABLE `AR_SHOP_GOODS` ADD `SELL_TYPE` VARCHAR(32) NOT NULL DEFAULT '1,2' COMMENT '出售方式';
+
+-- AR_ORDER_GOODS表结构修改
+ALTER TABLE `AR_ORDER_GOODS` ADD `POINT` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '兑换点数';
+
+-- AR_ORDER表结构修改
+ALTER TABLE `AR_ORDER` ADD `PAY_TYPE` VARCHAR(32) NOT NULL DEFAULT 'cash' COMMENT '支付方式';
+
+-- 03-15更新表结构
+ALTER TABLE `AR_FLOW_WALLET`
+ADD COLUMN `TRANSFER_SN` varchar(32) DEFAULT NULL AFTER `SORT`;
+
+ALTER TABLE `AR_DECLARATION_PACKAGE`
+ADD COLUMN `PACKAGE_NO` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT 'PG546763' AFTER `PACKAGE_NAME`;
+
+ALTER TABLE `AR_ORDER`
+ADD COLUMN `WAREHOUSE` varchar(16) COLLATE utf8mb4_bin NOT NULL DEFAULT '01' AFTER `PAY_TYPE`;
+
+UPDATE AR_CONFIG SET VALUE='[{"out":"bonus","in":"cash","outMin":"100","outMax":"0","fee":"3","feeMin":"0","feeMax":"0","weekMax":"0","monthMax":"0","isSystem":true,"isBind":true,"isOpen":true},{"out":"bonus","in":"bonus","outMin":"100","outMax":"0","fee":"0","feeMin":"0","feeMax":"0","weekMax":"0","monthMax":"0","isSystem":true,"isBind":true,"isOpen":true},{"out":"cash","in":"cash","outMin":"100","outMax":"0","fee":"0","feeMin":"0","feeMax":"0","weekMax":"0","monthMax":"0","isSystem":true,"isBind":true,"isOpen":true}]' WHERE CONFIG_NAME='allowWallet';
+
+-- ALTER TABLE `AR_USER_WALLET`
+-- MODIFY COLUMN `CASH` decimal(16, 2) UNSIGNED NOT NULL DEFAULT 0.00 AFTER `USER_ID`;
+-- ALTER TABLE `AR_USER_BONUS`
+-- MODIFY COLUMN `BONUS` decimal(16, 2) UNSIGNED NOT NULL DEFAULT 0.00 AFTER `USER_ID`;
+
+
+DROP TABLE IF EXISTS `AR_TMP_OLD_NETWORK`;
+CREATE TABLE `AR_TMP_OLD_NETWORK` (
+  `ID` varchar(32) NOT NULL,
+  `USER_NAME` varchar(16) NOT NULL,
+  `REAL_NAME` varchar(128) NOT NULL,
+  `PARENT_USER_NAME` varchar(16) NOT NULL,
+  `PARENT_REAL_NAME` varchar(128) NOT NULL,
+  `NET_USER_NAME` varchar(16) NOT NULL,
+  `NET_REAL_NAME` varchar(128) NOT NULL,
+  `SORT` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `NET_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `REC_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  PRIMARY KEY (`ID`),
+  KEY `USER_NAME` (`USER_NAME`) USING BTREE,
+  KEY `PARENT_USER_NAME` (`PARENT_USER_NAME`) USING BTREE,
+  KEY `NET_USER_NAME` (`NET_USER_NAME`) USING BTREE,
+  KEY `SORT` (`SORT`) USING BTREE,
+  KEY `NET_DEEP` (`NET_DEEP`) USING BTREE,
+  KEY `REC_DEEP` (`REC_DEEP`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='excel新增会员关系临时表';
+
+
+CREATE TABLE `AR_TMP_OLD_NETWORK_ALL` (
+  `ID` varchar(32) NOT NULL,
+  `USER_NAME` varchar(16) NOT NULL,
+  `REAL_NAME` varchar(128) NOT NULL,
+  `PARENT_USER_NAME` varchar(16) NOT NULL,
+  `PARENT_REAL_NAME` varchar(128) NOT NULL,
+  `NET_USER_NAME` varchar(16) NOT NULL,
+  `NET_REAL_NAME` varchar(128) NOT NULL,
+  `REC_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `NET_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `SORT` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `NET_SAME` tinyint(2) NOT NULL DEFAULT '0' COMMENT '相同0 不同1',
+  `REC_SAME` tinyint(2) NOT NULL DEFAULT '0',
+  `OLD_IS_EXSIT` tinyint(2) NOT NULL DEFAULT '0' COMMENT '0 不存在 1 存在',
+  PRIMARY KEY (`ID`),
+  KEY `USER_NAME` (`USER_NAME`) USING BTREE,
+  KEY `PARENT_USER_NAME` (`PARENT_USER_NAME`) USING BTREE,
+  KEY `NET_USER_NAME` (`NET_USER_NAME`) USING BTREE,
+  KEY `SORT` (`SORT`) USING BTREE,
+  KEY `NET_DEEP` (`NET_DEEP`) USING BTREE,
+  KEY `REC_DEEP` (`REC_DEEP`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='老系统总会员关系临时表';
+
+
+
+CREATE TABLE `AR_TMP_DELETE_USER` (
+  `ID` varchar(32) NOT NULL,
+  `USER_NAME` varchar(16) NOT NULL,
+  `REAL_NAME` varchar(128) NOT NULL,
+  `USER_ID` varchar(32) NOT NULL COMMENT '用户ID',
+  PRIMARY KEY (`ID`),
+  KEY `USER_ID` (`USER_ID`) USING BTREE,
+  KEY `USER_NAME` (`USER_NAME`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='线上会员多于34w的会员';
+
+
+
+CREATE TABLE `AR_TMP_OLD_NETWORK_ERROR` (
+  `ID` varchar(32) NOT NULL,
+  `USER_NAME` varchar(16) NOT NULL,
+  `REAL_NAME` varchar(128) NOT NULL,
+  `PARENT_USER_NAME` varchar(16) NOT NULL,
+  `PARENT_REAL_NAME` varchar(128) NOT NULL,
+  `NET_USER_NAME` varchar(16) NOT NULL,
+  `NET_REAL_NAME` varchar(128) NOT NULL,
+  `REC_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `NET_DEEP` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  `SORT` int(10) UNSIGNED NOT NULL DEFAULT '0',
+  PRIMARY KEY (`ID`),
+  KEY `USER_NAME` (`USER_NAME`) USING BTREE,
+  KEY `PARENT_USER_NAME` (`PARENT_USER_NAME`) USING BTREE,
+  KEY `NET_USER_NAME` (`NET_USER_NAME`) USING BTREE,
+  KEY `SORT` (`SORT`) USING BTREE,
+  KEY `NET_DEEP` (`NET_DEEP`) USING BTREE,
+  KEY `REC_DEEP` (`REC_DEEP`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='改错表';
+
+
+
+CREATE TABLE `AR_USER_REG` (
+  `ID` varchar(32) NOT NULL,
+  `USER_NAME` varchar(16) NOT NULL,
+  `REAL_NAME` varchar(128) NOT NULL,
+  `CON_UID` varchar(32) NOT NULL,
+  `REC_UID` varchar(32) NOT NULL,
+  `PARENT_USER_NAME` varchar(16) NOT NULL,
+  `PARENT_REAL_NAME` varchar(128) NOT NULL,
+  `NET_USER_NAME` varchar(16) NOT NULL,
+  `NET_REAL_NAME` varchar(128) NOT NULL,
+  PRIMARY KEY (`ID`),
+  KEY `USER_NAME` (`USER_NAME`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='正式站报单用户44';
+