Kaynağa Gözat

merge new-version reslove conflict

root 3 yıl önce
ebeveyn
işleme
97e5cb591c
63 değiştirilmiş dosya ile 16392 ekleme ve 16255 silme
  1. 491 491
      backendApi/config/menu.php
  2. 2764 2764
      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. 2043 2043
      backendEle/src/router/index.js
  31. 253 253
      backendEle/src/utils/network.js
  32. 4 1
      backendEle/src/views/finance/change-balance-opt.vue
  33. 181 181
      backendEle/src/views/reconsume/pool-list.vue
  34. 1 0
      backendEle/src/views/shop/dec-order-list.vue
  35. 846 845
      backendEle/src/views/user/index.vue
  36. 52 52
      common/components/Controller.php
  37. 69 58
      common/config/main.php
  38. 327 327
      common/config/params.php
  39. 156 156
      common/helpers/CaptchaAction.php
  40. 101 1
      common/helpers/bonus/BonusCalc.php
  41. 6 1
      common/helpers/bonus/BonusSend.php
  42. 2 0
      common/helpers/bonus/CalcCache.php
  43. 2 0
      common/libs/dataList/DataList.php
  44. 1 1
      common/models/BalanceAudit.php
  45. 290 290
      common/models/CalcBonus.php
  46. 69 69
      common/models/OrderGoods.php
  47. 71 71
      common/models/OrderGoodsDec.php
  48. 69 69
      common/models/OrderGoodsShop.php
  49. 175 175
      common/models/ShopGoods.php
  50. 1 1
      common/models/Transfer.php
  51. 59 59
      common/models/UserPeriodExchangePoints.php
  52. 610 610
      common/models/forms/OrderForm.php
  53. 549 549
      console/controllers/BonusController.php
  54. 4 4
      frontendApi/modules/v1/controllers/BonusController.php
  55. 236 235
      frontendApi/modules/v1/controllers/ShopController.php
  56. 2 1
      frontendEle/src/views/bonus/index.vue
  57. 48 47
      frontendEle/src/views/bonus/new.vue
  58. 101 99
      frontendEle/src/views/bonus/other.vue
  59. 253 252
      frontendEle/src/views/dashboard/index.vue
  60. 2 1
      frontendEle/src/views/finance/transfer-add.vue
  61. 91 89
      frontendEle/src/views/shop/dec-order-list.vue
  62. 1 1
      frontendEle/src/views/shop/order.vue
  63. 125 125
      mysql_db_yyj.sql

+ 491 - 491
backendApi/config/menu.php

@@ -1,492 +1,492 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: Leo
- * Date: 2017/9/3
- * Time: 下午3:23
- */
-return [
-//    'navigation' => [
-//        'name'=>'导航',
-//        'class' => 'list-header',
-//    ],
-    'dashboard'=>[
-        'name'=>'控制台',
-        'class' => '',
-        'icon'=>'el-icon-guide',
-        'controller'=>'dashboard',
-        'action'=>'index',
-        'routePath'=>'dashboard/index',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'总累计', 'class'=>'', 'icon'=>'', 'controller'=>'dashboard', 'action'=>'total-item', 'routePath'=>'dashboard/total-item', 'show'=>0,],
-            ['name'=>'会员月注册数量', 'class'=>'', 'icon'=>'', 'controller'=>'dashboard', 'action'=>'reg-num', 'routePath'=>'dashboard/reg-num', 'show'=>0,],
-            ['name'=>'月奖金量', 'class'=>'', 'icon'=>'', 'controller'=>'dashboard', 'action'=>'bonus-num', 'routePath'=>'dashboard/bonus-num', 'show'=>0,],
-            ['name'=>'月提现量', 'class'=>'', 'icon'=>'', 'controller'=>'dashboard', 'action'=>'withdraw-num', 'routePath'=>'dashboard/withdraw-num', 'show'=>0,],
-        ]
-    ],
-    'shop'=>[
-        'name'=>'商城管理',
-        'class' => '',
-        'icon'=>'el-icon-goods',
-        'controller'=>'shop',
-        'action'=>'',
-        'routePath'=>'shop',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'商品列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'index', 'routePath'=>'shop/index', 'show'=>1,],
-            // 新添加的商品操作  --- stat
-            ['name'=>'添加商品', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'goods-add', 'routePath'=>'shop/goods-add', 'show'=>0,],
-            ['name'=>'编辑商品', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'goods-edit', 'routePath'=>'shop/goods-edit', 'show'=>0,],
-            ['name'=>'删除商品', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'goods-delete', 'routePath'=>'shop/goods-delete', 'show'=>0,],
-            // 新添加的商品操作 ---stop
-            ['name'=>'商品列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'goods-list-export', 'routePath'=>'shop/goods-list-export', 'show'=>0,],
-            ['name'=>'套餐管理', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'package', 'routePath'=>'shop/package', 'show'=>1,],
-            ['name'=>'报单列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'dec-order-list', 'routePath'=>'shop/dec-order-list', 'show'=>1,],
-            ['name'=>'报单列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'dec-order-list-export', 'routePath'=>'shop/dec-order-list-export', 'show'=>0,],
-            ['name'=>'订单列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-list', 'routePath'=>'shop/order-list', 'show'=>1,],
-            ['name'=>'订单列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-list-export', 'routePath'=>'shop/order-list-export', 'show'=>0,],
-            ['name'=>'订单发货', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-delivery', 'routePath'=>'shop/order-delivery', 'show'=>0,],
-            ['name'=>'外部商城订单列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-shop-list', 'routePath'=>'shop/order-shop-list', 'show'=>1,],
-            ['name'=>'外部商城报单列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-dec-list', 'routePath'=>'shop/order-dec-list', 'show'=>1,],
-            ['name'=>'外部商城达标订单列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-standard-list', 'routePath'=>'shop/order-standard-list', 'show'=>1,],
-        ]
-    ],
-    'user'=>[
-        'name'=>'会员管理',
-        'class' => '',
-        'icon'=>'el-icon-user',
-        'controller'=>'user',
-        'action'=>'',
-        'routePath'=>'user',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'会员列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'index', 'routePath'=>'user/index', 'show'=>1,],
-            ['name'=>'登录到前台', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'login-to-frontend', 'routePath'=>'user/login-to-frontend', 'show'=>0,],
-            ['name'=>'指定会员管理登录管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'batch-close-login', 'routePath'=>'user/batch-close-login', 'show'=>0,],
-            ['name'=>'按条件登录管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'close-login', 'routePath'=>'user/close-login', 'show'=>0,],
-            ['name'=>'会员地区登录管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'close-area-login', 'routePath'=>'user/close-area-login', 'show'=>0,],
-            //['name'=>'会员运作管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-operating', 'routePath'=>'user/is-operating', 'show'=>0,],
-//            ['name'=>'会员团队领导人管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-group', 'routePath'=>'user/is-group', 'show'=>0,],
-            ['name'=>'会员报单中心管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-dec', 'routePath'=>'user/is-dec', 'show'=>0,],
-            ['name'=>'会员工作室管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-studio', 'routePath'=>'user/is-studio', 'show'=>0,],
-            ['name'=>'会员转账比例修改', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'change-transfer-prop', 'routePath'=>'user/change-transfer-prop', 'show'=>0,],
-//            ['name'=>'指定会员管理报单管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'batch-close-dec', 'routePath'=>'user/batch-close-dec', 'show'=>0,],
-//            ['name'=>'按条件报单管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'close-dec', 'routePath'=>'user/close-dec', 'show'=>0,],
-//            ['name'=>'会员地区报单管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'close-area-dec', 'routePath'=>'user/close-area-dec', 'show'=>0,],
-            ['name'=>'会员列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'index-export', 'routePath'=>'user/index-export', 'show'=>0,],
-            ['name'=>'图谱管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-atlas', 'routePath'=>'user/is-atlas', 'show'=>0,],
-            ['name'=>'充值管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-recharge', 'routePath'=>'user/is-recharge', 'show'=>0,],
-            ['name'=>'修改密码', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'modify-password', 'routePath'=>'user/modify-password', 'show'=>0,],
-            ['name'=>'查看个人资料', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'profile-get', 'routePath'=>'user/profile-get', 'show'=>0,],
-            ['name'=>'修改个人资料', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'modify-profile', 'routePath'=>'user/modify-profile', 'show'=>0,],
-            ['name'=>'会员状态', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'modify-status', 'routePath'=>'user/modify-status', 'show'=>0,],
-            ['name'=>'密码修改状态', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-modify-password-status', 'routePath'=>'user/is-modify-password-status', 'show'=>0,],
-            ['name'=>'空单操作', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'user-add-opt', 'routePath'=>'user/user-add-opt', 'show'=>1,],
-            ['name'=>'空单添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'user-add', 'routePath'=>'user/user-add', 'show'=>0,],
-            ['name'=>'空单列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'empty-list', 'routePath'=>'user/empty-list', 'show'=>1,],
-//            ['name'=>'空单批量1导入', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'import-users-to-excel-table', 'routePath'=>'user/import-users-to-excel-table', 'show'=>0,],
-//            ['name'=>'空单批量2添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'import-users-add', 'routePath'=>'user/import-users-add', 'show'=>0,],
-//            ['name'=>'空单删除', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'user-del', 'routePath'=>'user/user-del', 'show'=>0,],
-            //['name'=>'点位绑定', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'bind', 'routePath'=>'user/bind', 'show'=>1,],
-            //['name'=>'点位绑定添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'bind-add', 'routePath'=>'user/bind-add', 'show'=>0,],
-            //['name'=>'点位绑定编辑', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'bind-edit', 'routePath'=>'user/bind-edit', 'show'=>0,],
-            //['name'=>'点位绑定撤销', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'bind-delete', 'routePath'=>'user/bind-delete', 'show'=>0,],
-            //['name'=>'点位绑定导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'bind-export', 'routePath'=>'user/bind-export', 'show'=>0,],
-            //['name'=>'点位合作', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'teamwork', 'routePath'=>'user/teamwork', 'show'=>1,],
-            //['name'=>'点位合作添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'teamwork-add', 'routePath'=>'user/teamwork-add', 'show'=>0,],
-            //['name'=>'点位合作编辑', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'teamwork-edit', 'routePath'=>'user/teamwork-edit', 'show'=>0,],
-            //['name'=>'点位合作导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'teamwork-export', 'routePath'=>'user/teamwork-export', 'show'=>0,],
-            //['name'=>'体系管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system', 'routePath'=>'user/system', 'show'=>1,],
-            //['name'=>'体系添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-add', 'routePath'=>'user/system-add', 'show'=>0,],
-            //['name'=>'体系编辑', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-edit', 'routePath'=>'user/system-edit', 'show'=>0,],
-            //['name'=>'体系撤销', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-delete', 'routePath'=>'user/system-delete', 'show'=>0,],
-            //['name'=>'体系恢复', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-renew', 'routePath'=>'user/system-renew', 'show'=>0,],
-            //['name'=>'体系导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-export', 'routePath'=>'user/system-export', 'show'=>0,],
-            //['name'=>'团队领导人列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'group', 'routePath'=>'user/group', 'show'=>1,],
-            //['name'=>'团队领导人列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'group-export', 'routePath'=>'user/group-export', 'show'=>0,],
-            ['name'=>'移网管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move', 'routePath'=>'user/move', 'show'=>1,],
-            ['name'=>'申请移网', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-add', 'routePath'=>'user/move-add', 'show'=>0,],
-            ['name'=>'移网修改并审核', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-pass', 'routePath'=>'user/move-pass', 'show'=>0,],
-            ['name'=>'移网审核', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-audit', 'routePath'=>'user/move-audit', 'show'=>0,],
-            ['name'=>'移网导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-export', 'routePath'=>'user/move-export', 'show'=>0,],
-            ['name'=>'移网审核删除', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-delete', 'routePath'=>'user/move-delete', 'show'=>0,],
-            //['name'=>'注册信息报表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info', 'routePath'=>'user/reg-info', 'show'=>1,],
-            //['name'=>'修改注册信息', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-edit', 'routePath'=>'user/reg-info-edit', 'show'=>0,],
-            //['name'=>'注册信息审核列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-audit', 'routePath'=>'user/reg-info-audit', 'show'=>1,],
-            //['name'=>'注册信息添加操作', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-audit-add-opt', 'routePath'=>'user/reg-info-audit-add-opt', 'show'=>0,],
-            //['name'=>'注册信息添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-audit-add', 'routePath'=>'user/reg-info-audit-add', 'show'=>0,],
-            //['name'=>'注册信息批量1导入', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'import-reg-info-to-excel-table', 'routePath'=>'user/import-reg-info-to-excel-table', 'show'=>0,],
-            //['name'=>'注册信息批量2添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'import-reg-info', 'routePath'=>'user/import-reg-info', 'show'=>0,],
-            //['name'=>'审核注册信息', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-audit-audit', 'routePath'=>'user/reg-info-audit-audit', 'show'=>0,],
-            //['name'=>'删除审核注册信息', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-audit-delete', 'routePath'=>'user/reg-info-audit-delete', 'show'=>0,],
-            //['name'=>'会员状态管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'status-audit-list', 'routePath'=>'user/status-audit-list', 'show'=>1,],
-            //['name'=>'会员状态管理导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'user/status-audit-export', 'routePath'=>'user/user/status-audit-export', 'show'=>0,],
-            //['name'=>'申请修改会员状态', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'status-audit-add', 'routePath'=>'user/status-audit-add', 'show'=>0,],
-            //['name'=>'审核会员状态', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'status-audit', 'routePath'=>'user/status-audit', 'show'=>0,],
-            //['name'=>'删除审核会员状态', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'status-audit-delete', 'routePath'=>'user/status-audit-delete', 'show'=>0,],
-            ['name'=>'会员级别调整列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'change-user-dec-level', 'routePath'=>'user/dec-level-list', 'show'=>1,],
-            ['name'=>'修改会员级别', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'change-user-dec-level', 'routePath'=>'user/change-user-dec-level', 'show'=>0,],
-            ['name'=>'修改报单中心级别', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'change-user-dec-role', 'routePath'=>'user/change-user-dec-role', 'show'=>1,],
-            //['name'=>'清空关停会员钱包', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'clear-wallet', 'routePath'=>'user/clear-wallet', 'show'=>0,],
-//            ['name'=>'会员历史年度最高聘级表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'year-highest-emp-lv', 'routePath'=>'user/year-highest-emp-lv', 'show'=>1,],
-//            ['name'=>'会员历史年度最高聘级表导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'user/year-highest-emp-lv-export', 'routePath'=>'user/user/year-highest-emp-lv-export', 'show'=>0,],
-            //['name'=>'修改会员前台显示聘级', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'change-show-emp-level', 'routePath'=>'user/change-show-emp-level', 'show'=>1,],
-        ]
-    ],
-    'atlas'=>[
-        'name'=>'网络图谱',
-        'class' => '',
-        'icon'=>'el-icon-data-line',
-        'controller'=>'atlas',
-        'action'=>'',
-        'routePath'=>'atlas',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'开拓网络', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'relation-opt', 'routePath'=>'atlas/relation-opt', 'show'=>1,],
-            ['name'=>'开拓网络图', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'relation', 'routePath'=>'atlas/relation', 'show'=>0,],
-            ['name'=>'开拓网络列表', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'relation-list', 'routePath'=>'atlas/relation-list', 'show'=>0,],
-            ['name'=>'开拓网络列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'relation-list-export', 'routePath'=>'atlas/relation-list-export', 'show'=>0,],
-            ['name'=>'安置网络', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'network-opt', 'routePath'=>'atlas/network-opt', 'show'=>1,],
-            ['name'=>'安置网络图', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'network', 'routePath'=>'atlas/network', 'show'=>0,],
-            ['name'=>'安置网络列表', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'network-list', 'routePath'=>'atlas/network-list', 'show'=>0,],
-            ['name'=>'安置网络列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'network-list-export', 'routePath'=>'atlas/network-list-export', 'show'=>0,],
-        ]
-    ],
-//    'reconsume'=>[
-//        'name'=>'复销管理',
-//        'class' => '',
-//        'icon'=>'el-icon-shopping-bag-1',
-//        'controller'=>'reconsume',
-//        'action'=>'',
-//        'routePath'=>'reconsume',
-//        'show'=>1,
-//        'child'=>[
-//            ['name'=>'复销池余额列表', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'pool-list', 'routePath'=>'reconsume/pool-list', 'show'=>1,],
-////            ['name'=>'手动扣除月复销', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'deduct', 'routePath'=>'reconsume/deduct', 'show'=>1,],
-//            ['name'=>'复销余额调整审核', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit-list', 'routePath'=>'reconsume/change-audit-list', 'show'=>1,],
-//            ['name'=>'复销余额调整审核导出', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit-list-export', 'routePath'=>'reconsume/change-audit-list-export', 'show'=>0,],
-//            ['name'=>'修改并通过审核余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit-pass', 'routePath'=>'reconsume/change-audit-pass', 'show'=>0,],
-//            ['name'=>'审核余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit', 'routePath'=>'reconsume/change-audit', 'show'=>0,],
-//            ['name'=>'申请余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit-add', 'routePath'=>'reconsume/change-audit-add', 'show'=>0,],
-//            ['name'=>'删除余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit-delete', 'routePath'=>'reconsume/change-audit-delete', 'show'=>0,],
-//            //['name'=>'扣除复销审核', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'deduct-audit-list', 'routePath'=>'reconsume/deduct-audit-list', 'show'=>1,],
-//            ['name'=>'手动扣除月复销', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'deduct-audit-add', 'routePath'=>'reconsume/deduct-audit-add', 'show'=>0,],
-//            ['name'=>'复销流水', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'flow-list', 'routePath'=>'reconsume/flow-list', 'show'=>1,],
-//        ]
-//    ],
-    'bonus'=>[
-        'name'=>'奖金管理',
-        'class' => '',
-        'icon'=>'el-icon-coin',
-        'controller'=>'bonus',
-        'action'=>'',
-        'routePath'=>'bonus',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'封期管理', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'period', 'routePath'=>'bonus/period', 'show'=>1,],
-            ['name'=>'封期操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'close-period', 'routePath'=>'bonus/close-period', 'show'=>0,],
-            ['name'=>'生成业绩单', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-period', 'routePath'=>'bonus/perf-period', 'show'=>0,],
-            ['name'=>'结算操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'calc-period', 'routePath'=>'bonus/calc-period', 'show'=>0,],
-            ['name'=>'挂网操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'send-period', 'routePath'=>'bonus/send-period', 'show'=>0,],
-            ['name'=>'会员奖金余额', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'balance-list', 'routePath'=>'bonus/balance-list', 'show'=>1,],
-            ['name'=>'会员奖金余额导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'balance-export', 'routePath'=>'bonus/balance-export', 'show'=>0,],
-//            ['name'=>'申请发放年度奖', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'cf-lx-apply', 'routePath'=>'bonus/cf-lx-apply', 'show'=>0,],
-//            ['name'=>'年度奖金发放审核', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'cf-lx-audit-list', 'routePath'=>'bonus/cf-lx-audit-list', 'show'=>1,],
-//            ['name'=>'年度奖发放审核操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'cf-lx-audit', 'routePath'=>'bonus/cf-lx-audit', 'show'=>0,],
-            //['name'=>'期奖金明细', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'period-detail', 'routePath'=>'bonus/period-detail', 'show'=>0,],
-            ['name'=>'最新奖金', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'new-period-bonus', 'routePath'=>'bonus/new-period-bonus', 'show'=>1,],
-            ['name'=>'最新奖金导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'new-period-bonus-export', 'routePath'=>'bonus/new-period-bonus-export', 'show'=>0,],
-            ['name'=>'往期奖金', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'other-period-bonus', 'routePath'=>'bonus/other-period-bonus', 'show'=>1,],
-            ['name'=>'往期奖金导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'other-period-bonus-export', 'routePath'=>'bonus/other-period-bonus-export', 'show'=>0,],
-            ['name'=>'奖金流水', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-bonus', 'routePath'=>'bonus/flow-bonus', 'show'=>1,],
-            ['name'=>'奖金流水导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-bonus-export', 'routePath'=>'bonus/flow-bonus-export', 'show'=>0,],
-//            ['name'=>'车房养老奖流水', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-cf', 'routePath'=>'bonus/flow-cf', 'show'=>1,],
-//            ['name'=>'车房养老奖流水导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-cf-export', 'routePath'=>'bonus/flow-cf-export', 'show'=>0,],
-//            ['name'=>'领袖分红奖流水', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-lx', 'routePath'=>'bonus/flow-lx', 'show'=>1,],
-//            ['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-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,],
-//            ['name'=>'区域津贴补发列表', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-list', 'routePath'=>'bonus/resend-qy-list', 'show'=>1,],
-//            ['name'=>'区域津贴补发列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-list-export', 'routePath'=>'bonus/resend-qy-list-export', 'show'=>0,],
-//            ['name'=>'申请补发区域津贴', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy', 'routePath'=>'bonus/resend-qy', 'show'=>0,],
-//            ['name'=>'补发区域津贴审核列表', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-audit-list', 'routePath'=>'bonus/resend-qy-audit-list', 'show'=>1,],
-//            ['name'=>'补发区域津贴审核列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-audit-list-export', 'routePath'=>'bonus/resend-qy-audit-list-export', 'show'=>0,],
-//            ['name'=>'补发区域津贴审核操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-audit', 'routePath'=>'bonus/resend-qy-audit', 'show'=>0,],
-//            ['name'=>'补发区域津贴审核删除', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-audit-delete', 'routePath'=>'bonus/resend-qy-audit-delete', 'show'=>0,],
-            ['name'=>'团队奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-qy', 'routePath'=>'bonus/trace-down-qy', 'show'=>1,],
-            ['name'=>'团队奖下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-qy-export', 'routePath'=>'bonus/trace-down-qy-export', 'show'=>0,],
-            ['name'=>'团队奖向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-qy', 'routePath'=>'bonus/trace-up-qy', 'show'=>1,],
-            ['name'=>'团队奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-qy-export', 'routePath'=>'bonus/trace-up-qy-export', 'show'=>0,],
-            ['name'=>'荣衔奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-yc', 'routePath'=>'bonus/trace-down-yc', 'show'=>1,],
-            ['name'=>'荣衔奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-yc-export', 'routePath'=>'bonus/trace-down-yc-export', 'show'=>0,],
-            ['name'=>'荣衔奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-yc', 'routePath'=>'bonus/trace-up-yc', 'show'=>1,],
-            ['name'=>'荣衔奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-yc-export', 'routePath'=>'bonus/trace-up-yc-export', 'show'=>0,],
-            ['name'=>'服务奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-bd', 'routePath'=>'bonus/trace-down-bd', 'show'=>1,],
-            ['name'=>'服务奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-bd-export', 'routePath'=>'bonus/trace-down-bd-export', 'show'=>0,],
-            ['name'=>'服务奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-bd', 'routePath'=>'bonus/trace-up-bd', 'show'=>1,],
-            ['name'=>'服务奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-bd-export', 'routePath'=>'bonus/trace-up-bd-export', 'show'=>0,],
-            ['name'=>'推广奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-tg', 'routePath'=>'bonus/trace-down-tg', 'show'=>1,],
-            ['name'=>'推广奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-tg-export', 'routePath'=>'bonus/trace-down-tg-export', 'show'=>0,],
-            ['name'=>'推广奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-tg', 'routePath'=>'bonus/trace-up-tg', 'show'=>1,],
-            ['name'=>'推广奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-tg-export', 'routePath'=>'bonus/trace-up-tg-export', 'show'=>0,],
-            ['name'=>'消费奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-xf', 'routePath'=>'bonus/trace-down-xf', 'show'=>1,],
-            ['name'=>'消费奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-xf-export', 'routePath'=>'bonus/trace-down-xf-export', 'show'=>0,],
-            ['name'=>'消费奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-xf', 'routePath'=>'bonus/trace-up-xf', 'show'=>1,],
-            ['name'=>'消费奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-xf-export', 'routePath'=>'bonus/trace-up-xf-export', 'show'=>0,],
-            ['name'=>'业绩奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-yj', 'routePath'=>'bonus/trace-down-yj', 'show'=>1,],
-            ['name'=>'业绩奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-yj-export', 'routePath'=>'bonus/trace-down-yj-export', 'show'=>0,],
-            ['name'=>'业绩奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-yj', 'routePath'=>'bonus/trace-up-yj', 'show'=>1,],
-            ['name'=>'业绩奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-yj-export', 'routePath'=>'bonus/trace-up-yj-export', 'show'=>0,],
-            ['name'=>'共享奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-gx', 'routePath'=>'bonus/trace-down-gx', 'show'=>1,],
-            ['name'=>'共享奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-gx-export', 'routePath'=>'bonus/trace-down-gx-export', 'show'=>0,],
-            ['name'=>'共享奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-gx', 'routePath'=>'bonus/trace-up-gx', 'show'=>1,],
-            ['name'=>'共享奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-gx-export', 'routePath'=>'bonus/trace-up-gx-export', 'show'=>0,],
-            ['name'=>'管理奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-gl', 'routePath'=>'bonus/trace-down-gl', 'show'=>1,],
-            ['name'=>'管理奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-gl-export', 'routePath'=>'bonus/trace-down-gl-export', 'show'=>0,],
-            ['name'=>'管理奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-gl', 'routePath'=>'bonus/trace-up-gl', 'show'=>1,],
-            ['name'=>'管理奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-gl-export', 'routePath'=>'bonus/trace-up-gl-export', 'show'=>0,],
-            ['name'=>'用户业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'user-perf', 'routePath'=>'bonus/user-perf', 'show'=>1,],
-            ['name'=>'荣衔业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'yc-perf', 'routePath'=>'bonus/yc-perf', 'show'=>1,],
-            ['name'=>'达标业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-standard', 'routePath'=>'bonus/perf-standard', 'show'=>1,],
-            ['name'=>'达标业绩导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-standard-export', 'routePath'=>'bonus/perf-standard-export', 'show'=>0,],
-//            ['name'=>'复销奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-fx', 'routePath'=>'bonus/trace-down-fx', 'show'=>1,],
-//            ['name'=>'复销奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-fx-export', 'routePath'=>'bonus/trace-down-fx-export', 'show'=>0,],
-//            ['name'=>'复销奖向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-fx', 'routePath'=>'bonus/trace-up-fx', 'show'=>1,],
-//            ['name'=>'复销奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-fx-export', 'routePath'=>'bonus/trace-up-fx-export', 'show'=>0,],
-//            ['name'=>'报单中心补贴追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-bt', 'routePath'=>'bonus/trace-bt', 'show'=>1,],
-//            ['name'=>'报单中心补贴追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-bt-export', 'routePath'=>'bonus/trace-bt-export', 'show'=>0,],
-//            ['name'=>'报单中心货补追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-fl', 'routePath'=>'bonus/trace-fl', 'show'=>1,],
-//            ['name'=>'报单中心货补追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-fl-export', 'routePath'=>'bonus/trace-fl-export', 'show'=>0,],
-//            ['name'=>'区域业绩提成追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-fw', 'routePath'=>'bonus/trace-fw', 'show'=>1,],
-//            ['name'=>'区域业绩提成追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-fw-export', 'routePath'=>'bonus/trace-fw-export', 'show'=>0,],
-            ['name'=>'业绩单', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-order', 'routePath'=>'bonus/perf-order', 'show'=>1,],
-            ['name'=>'业绩单导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-order-export', 'routePath'=>'bonus/perf-order-export', 'show'=>0,],
-//            ['name'=>'会员实时业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'real-time-perf', 'routePath'=>'bonus/real-time-perf', 'show'=>1,],
-            ['name'=>'期业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-period-list', 'routePath'=>'bonus/perf-period-list', 'show'=>1,],
-            ['name'=>'期业绩导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-period-list-export', 'routePath'=>'bonus/perf-period-list-export', 'show'=>0,],
-            ['name'=>'月业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-month', 'routePath'=>'bonus/perf-month', 'show'=>1,],
-            ['name'=>'月业绩导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-month-export', 'routePath'=>'bonus/perf-month-export', 'show'=>0,],
-            ['name'=>'月积分', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'score-month', 'routePath'=>'bonus/score-month', 'show'=>1,],
-            ['name'=>'月积分导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'score-month-export', 'routePath'=>'bonus/score-month-export', 'show'=>0,],
-        ]
-    ],
-    /*'report'=>[
-        'name'=>'报表管理',
-        'class' => '',
-        'icon'=>'el-icon-data-analysis',
-        'controller'=>'report',
-        'action'=>'',
-        'routePath'=>'report',
-        'show'=>1,
-        'child'=>[
-        ]
-    ],*/
-    'finance'=>[
-        'name'=>'财务管理',
-        'class' => '',
-        'icon'=>'el-icon-bank-card',
-        'controller'=>'finance',
-        'action'=>'',
-        'routePath'=>'finance',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'会员余额调整列表', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'balance-audit-list', 'routePath'=>'finance/balance-audit-list', 'show'=>1,],
-            ['name'=>'会员余额调整列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'balance-audit-list-export', 'routePath'=>'finance/balance-audit-list-export', 'show'=>0,],
-            ['name'=>'修改并通过审核余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'balance-audit-pass', 'routePath'=>'finance/balance-audit-pass', 'show'=>0,],
-            ['name'=>'审核会员余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'balance-audit', 'routePath'=>'finance/balance-audit', 'show'=>0,],
-            ['name'=>'删除审核会员余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'balance-audit-delete', 'routePath'=>'finance/balance-audit-delete', 'show'=>0,],
-            ['name'=>'申请调整会员余额操作', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'change-balance-opt', 'routePath'=>'finance/change-balance-opt', 'show'=>0,],
-            ['name'=>'申请调整会员余额', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'change-balance', 'routePath'=>'finance/change-balance', 'show'=>0,],
-            ['name'=>'申请调整会员余额批量1导入', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'import-change-balance-to-excel-table', 'routePath'=>'finance/import-change-balance-to-excel-table', 'show'=>0,],
-            ['name'=>'申请调整会员余额批量2添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'import-change-balance', 'routePath'=>'finance/import-change-balance', 'show'=>0,],
-//            ['name'=>'会员业绩调整列表', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-audit-list', 'routePath'=>'finance/perf-audit-list', 'show'=>1,],
-//            ['name'=>'会员业绩调整列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-audit-list-export', 'routePath'=>'finance/perf-audit-list-export', 'show'=>0,],
-            ['name'=>'修改并通过审核业绩调整', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-audit-pass', 'routePath'=>'finance/perf-audit-pass', 'show'=>0,],
-            ['name'=>'审核会员业绩调整', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-audit', 'routePath'=>'finance/perf-audit', 'show'=>0,],
-            ['name'=>'删除审核调整会员业绩', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-audit-delete', 'routePath'=>'finance/perf-audit-delete', 'show'=>0,],
-            ['name'=>'申请调整会员业绩', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-apply', 'routePath'=>'finance/perf-apply', 'show'=>0,],
-            ['name'=>'转账记录列表', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'transfer-list', 'routePath'=>'finance/transfer-list', 'show'=>1,],
-            ['name'=>'转账记录列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'transfer-list-export', 'routePath'=>'finance/transfer-list-export', 'show'=>0,],
-            ['name'=>'提现管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw', 'routePath'=>'finance/withdraw', 'show'=>1,],
-//            ['name'=>'提现管理-待传发票', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-0', 'routePath'=>'finance/withdraw-0', 'show'=>0,],
-//            ['name'=>'提现管理-提现待审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-0', 'routePath'=>'finance/withdraw-0', 'show'=>0,],
-//            ['name'=>'提现管理-提现已审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-2', 'routePath'=>'finance/withdraw-2', 'show'=>0,],
-//            ['name'=>'提现管理-提现待付款', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-3', 'routePath'=>'finance/withdraw-3', 'show'=>0,],
-//            ['name'=>'提现管理-提现已付款', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-6', 'routePath'=>'finance/withdraw-6', 'show'=>0,],
-//            ['name'=>'提现管理-付款失败', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-4', 'routePath'=>'finance/withdraw-4', 'show'=>0,],
-//            ['name'=>'提现管理-提现退回', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-7', 'routePath'=>'finance/withdraw-7', 'show'=>0,],
-            ['name'=>'审核提现信息', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-status', 'routePath'=>'finance/withdraw-status', 'show'=>0,],
-            //['name'=>'发票信息添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit-add', 'routePath'=>'finance/invoice-audit-add', 'show'=>0,],
-            //['name'=>'发票信息编辑', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit-edit', 'routePath'=>'finance/invoice-audit-edit', 'show'=>0,],
-            //['name'=>'标记付款失败批量1导入', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'import-withdraws-to-excel-table', 'routePath'=>'finance/import-withdraws-to-excel-table', 'show'=>0,],
-            //['name'=>'标记付款失败批量2添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'import-withdraws-paid-false', 'routePath'=>'finance/import-withdraws-paid-false', 'show'=>0,],
-//            ['name'=>'发票管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit', 'routePath'=>'finance/invoice-audit', 'show'=>1,],
-//            ['name'=>'发票审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit-audit', 'routePath'=>'finance/invoice-audit-audit', 'show'=>0,],
-//            ['name'=>'发票删除', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit-delete', 'routePath'=>'finance/invoice-audit-delete', 'show'=>0,],
-            //['name'=>'填写发票', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit-add', 'routePath'=>'finance/invoice-audit-add', 'show'=>0,],
-            //['name'=>'发票流水', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-flow', 'routePath'=>'finance/invoice-flow', 'show'=>1,],
-            //['name'=>'发票调整管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-balance-audit', 'routePath'=>'finance/invoice-balance-audit', 'show'=>1,],
-            //['name'=>'发票调整添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-balance-audit-add', 'routePath'=>'finance/invoice-balance-audit-add', 'show'=>0,],
-            ['name'=>'提现导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-export', 'routePath'=>'finance/withdraw-export', 'show'=>0,],
-            ['name'=>'交易类型管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type', 'routePath'=>'finance/deal-type', 'show'=>1,],
-            ['name'=>'交易类型添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type-add', 'routePath'=>'finance/deal-type-add', 'show'=>0,],
-            ['name'=>'交易类型修改', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type-edit', 'routePath'=>'finance/deal-type-edit', 'show'=>0,],
-            ['name'=>'历史奖金余额', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'history-bonus', 'routePath'=>'finance/history-bonus', 'show'=>1,],
-            ['name'=>'历史奖金余额导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'history-bonus-export', 'routePath'=>'finance/history-bonus-export', 'show'=>0,],
-            ['name'=>'充值管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge', 'routePath'=>'finance/recharge', 'show'=>1,],
-            ['name'=>'充值导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-export', 'routePath'=>'finance/recharge-export', 'show'=>0,],
-            //['name'=>'充值管理-充值待审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-0', 'routePath'=>'finance/recharge-0', 'show'=>0,],
-            //['name'=>'充值管理-充值已审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-1', 'routePath'=>'finance/recharge-1', 'show'=>0,],
-            //['name'=>'充值管理-充值已驳回', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-2', 'routePath'=>'finance/recharge-2', 'show'=>0,],
-            ['name'=>'审核充值信息', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-status', 'routePath'=>'finance/recharge-status', 'show'=>0,],
-        ]
-    ],
-    'article'=>[
-        'name'=>'文章管理',
-        'class' => '',
-        'icon'=>'el-icon-collection',
-        'controller'=>'article',
-        'action'=>'',
-        'routePath'=>'article',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'分类管理', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category', 'routePath'=>'article/category', 'show'=>1,],
-            ['name'=>'添加分类', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-add', 'routePath'=>'article/category-add', 'show'=>0,],
-            ['name'=>'删除分类', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-delete', 'routePath'=>'article/category-delete', 'show'=>0,],
-            ['name'=>'分类排序', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-sort', 'routePath'=>'article/category-sort', 'show'=>0,],
-            ['name'=>'文章列表', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'index', 'routePath'=>'article/index', 'show'=>1,],
-            ['name'=>'添加文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'add', 'routePath'=>'article/add', 'show'=>0,],
-            ['name'=>'编辑文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'edit', 'routePath'=>'article/edit', 'show'=>0,],
-            ['name'=>'删除文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'article-delete', 'routePath'=>'article/article-delete', 'show'=>0,],
-
-        ]
-    ],
-//    'message'=>[
-//        'name'=>'站内信管理',
-//        'class' => '',
-//        'icon'=>'fa fa-envelope-o',
-//        'controller'=>'message',
-//        'action'=>'',
-//        'routePath'=>'message',
-//        'show'=>1,
-//        'child'=>[
-//            ['name'=>'站内信列表', 'class'=>'', 'icon'=>'', 'controller'=>'message', 'action'=>'list', 'routePath'=>'message/list', 'show'=>1,],
-//            ['name'=>'添加站内信', 'class'=>'', 'icon'=>'', 'controller'=>'message', 'action'=>'add', 'routePath'=>'message/add', 'show'=>0,],
-//            ['name'=>'删除站内信', 'class'=>'', 'icon'=>'', 'controller'=>'message', 'action'=>'delete', 'routePath'=>'message/delete', 'show'=>0,],
-//        ]
-//    ],
-    'file'=>[
-        'name'=>'文件管理',
-        'class' => '',
-        'icon'=>'el-icon-files',
-        'controller'=>'file',
-        'action'=>'',
-        'routePath'=>'file',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'导出文件', 'class'=>'', 'icon'=>'', 'controller'=>'file', 'action'=>'export', 'routePath'=>'file/export', 'show'=>1,],
-            ['name'=>'删除文件', 'class'=>'', 'icon'=>'', 'controller'=>'file', 'action'=>'export-delete', 'routePath'=>'file/export-delete', 'show'=>0,],
-
-        ]
-    ],
-//    'sys' => [
-//        'name'=>'系统相关',
-//        'class' => 'list-header',
-//    ],
-    'admin'=>[
-        'name'=>'管理员管理',
-        'class' => '',
-        'icon'=>'el-icon-coordinate',
-        'controller'=>'admin',
-        'action'=>'',
-        'routePath'=>'admin',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'管理员角色列表', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role', 'routePath'=>'admin/role', 'show'=>1,],
-            ['name'=>'添加管理员角色', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role-add', 'routePath'=>'admin/role-add', 'show'=>0,],
-            ['name'=>'编辑管理员角色', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role-edit', 'routePath'=>'admin/role-edit', 'show'=>0,],
-            ['name'=>'删除管理员角色', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role-delete', 'routePath'=>'admin/role-delete', 'show'=>0,],
-            ['name'=>'管理员权限', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role-permission', 'routePath'=>'admin/role-permission', 'show'=>0,],
-            ['name'=>'管理员列表字段权限', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role-column', 'routePath'=>'admin/role-column', 'show'=>0,],
-            ['name'=>'管理员列表', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'index', 'routePath'=>'admin/index', 'show'=>1,],
-            ['name'=>'添加管理员', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'add', 'routePath'=>'admin/add', 'show'=>0,],
-            ['name'=>'编辑管理员', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'edit', 'routePath'=>'admin/edit', 'show'=>0,],
-            ['name'=>'删除管理员', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'admin-delete', 'routePath'=>'admin/admin-delete', 'show'=>0,],
-            ['name'=>'重置密码', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'change-password', 'routePath'=>'admin/change-password', 'show'=>1,],
-        ]
-    ],
-    'ad'=>[
-        'name'=>'广告管理',
-        'class' => '',
-        'icon'=>'el-icon-picture-outline',
-        'controller'=>'ad',
-        'action'=>'',
-        'routePath'=>'ad',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'广告位', 'class'=>'', 'icon'=>'', 'controller'=>'ad', 'action'=>'location', 'routePath'=>'ad/location', 'show'=>1,],
-            ['name'=>'广告列表', 'class'=>'', 'icon'=>'', 'controller'=>'ad', 'action'=>'list', 'routePath'=>'ad/list', 'show'=>0,],
-            ['name'=>'添加广告', 'class'=>'', 'icon'=>'', 'controller'=>'ad', 'action'=>'add', 'routePath'=>'ad/add', 'show'=>0,],
-            ['name'=>'编辑广告', 'class'=>'', 'icon'=>'', 'controller'=>'ad', 'action'=>'edit', 'routePath'=>'ad/edit', 'show'=>0,],
-            ['name'=>'删除广告', 'class'=>'', 'icon'=>'', 'controller'=>'ad', 'action'=>'ad-delete', 'routePath'=>'ad/ad-delete', 'show'=>0,],
-        ]
-    ],
-    'log'=>[
-        'name'=>'日志管理',
-        'class' => '',
-        'icon'=>'el-icon-collection',
-        'controller'=>'log',
-        'action'=>'',
-        'routePath'=>'log',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'管理员登录日志', 'class'=>'', 'icon'=>'', 'controller'=>'log', 'action'=>'admin-login', 'routePath'=>'log/admin-login', 'show'=>1,],
-            ['name'=>'会员登录日志', 'class'=>'', 'icon'=>'', 'controller'=>'log', 'action'=>'user-login', 'routePath'=>'log/user-login', 'show'=>1,],
-            ['name'=>'管理员操作日志', 'class'=>'', 'icon'=>'', 'controller'=>'log', 'action'=>'admin-handle', 'routePath'=>'log/admin-handle', 'show'=>1,],
-            ['name'=>'会员操作日志', 'class'=>'', 'icon'=>'', 'controller'=>'log', 'action'=>'user-handle', 'routePath'=>'log/user-handle', 'show'=>1,],
-            ['name'=>'系统日志', 'class'=>'', 'icon'=>'', 'controller'=>'log', 'action'=>'system', 'routePath'=>'log/system', 'show'=>1,],
-
-        ]
-    ],
-    'config' => [
-        'name'=>'设置管理',
-        'class' => '',
-        'icon'=>'el-icon-set-up',
-        'controller'=>'config',
-        'action'=>'',
-        'routePath'=>'config',
-        'show'=>1,
-        'child'=>[
-            ['name'=>'站点设置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'base', 'routePath'=>'config/base', 'show'=>1,],
-            ['name'=>'奖金设置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-opt', 'routePath'=>'config/bonus-opt', 'show'=>1,],
-            ['name'=>'奖金基本配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus', 'routePath'=>'config/bonus', 'show'=>0,],
-            ['name'=>'区域/复销奖配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-dec-level', 'routePath'=>'config/bonus-dec-level', 'show'=>0,],
-            ['name'=>'育成/车房/养老配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-emp-level', 'routePath'=>'config/bonus-emp-level', 'show'=>0,],
-            ['name'=>'期数配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'period', 'routePath'=>'config/period', 'show'=>1,],
-//            ['name'=>'会员注册类型配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'reg-type', 'routePath'=>'config/reg-type', 'show'=>1,],
-//            ['name'=>'会员注册类型编辑', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'reg-type-edit', 'routePath'=>'config/reg-type-edit', 'show'=>0,],
-//            ['name'=>'维护注册协议', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'pact-edit', 'routePath'=>'config/pact-edit', 'show'=>0,],
-            ['name'=>'第三方接口', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'api-opt', 'routePath'=>'config/api-opt', 'show'=>1,],
-            ['name'=>'OCR接口编辑', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'ocr-api-edit', 'routePath'=>'config/ocr-api-edit', 'show'=>0,],
-            ['name'=>'短信接口编辑', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'ocr-api-edit', 'routePath'=>'config/ocr-api-edit', 'show'=>0,],
-            ['name'=>'短信管理', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'sms', 'routePath'=>'config/sms', 'show'=>1,],
-            ['name'=>'积分配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'score', 'routePath'=>'config/score', 'show'=>1,],
-            ['name'=>'转账配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'transfer', 'routePath'=>'config/transfer', 'show'=>1,],
-            ['name'=>'其他配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'other', 'routePath'=>'config/other', 'show'=>1,],
-            ['name'=>'会员级别配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-level', 'routePath'=>'config/dec-level', 'show'=>1,],
-            ['name'=>'添加会员级别', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-level-add', 'routePath'=>'config/dec-level-add', 'show'=>0,],
-            ['name'=>'编辑会员级别', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-level-edit', 'routePath'=>'config/dec-level-edit', 'show'=>0,],
-            ['name'=>'会员聘级配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level', 'routePath'=>'config/emp-level', 'show'=>1,],
-            ['name'=>'添加会员聘级', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level-add', 'routePath'=>'config/emp-level-add', 'show'=>0,],
-            ['name'=>'编辑会员聘级', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level-edit', 'routePath'=>'config/emp-level-edit', 'show'=>0,],
-            ['name'=>'报单中心级别配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-role', 'routePath'=>'config/dec-role', 'show'=>1,],
-            ['name'=>'编辑报单中心级别', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-role-edit', 'routePath'=>'config/dec-role-edit', 'show'=>0,],
-        ],
-    ],
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Leo
+ * Date: 2017/9/3
+ * Time: 下午3:23
+ */
+return [
+//    'navigation' => [
+//        'name'=>'导航',
+//        'class' => 'list-header',
+//    ],
+    'dashboard'=>[
+        'name'=>'控制台',
+        'class' => '',
+        'icon'=>'el-icon-guide',
+        'controller'=>'dashboard',
+        'action'=>'index',
+        'routePath'=>'dashboard/index',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'总累计', 'class'=>'', 'icon'=>'', 'controller'=>'dashboard', 'action'=>'total-item', 'routePath'=>'dashboard/total-item', 'show'=>0,],
+            ['name'=>'会员月注册数量', 'class'=>'', 'icon'=>'', 'controller'=>'dashboard', 'action'=>'reg-num', 'routePath'=>'dashboard/reg-num', 'show'=>0,],
+            ['name'=>'月奖金量', 'class'=>'', 'icon'=>'', 'controller'=>'dashboard', 'action'=>'bonus-num', 'routePath'=>'dashboard/bonus-num', 'show'=>0,],
+            ['name'=>'月提现量', 'class'=>'', 'icon'=>'', 'controller'=>'dashboard', 'action'=>'withdraw-num', 'routePath'=>'dashboard/withdraw-num', 'show'=>0,],
+        ]
+    ],
+    'shop'=>[
+        'name'=>'商城管理',
+        'class' => '',
+        'icon'=>'el-icon-goods',
+        'controller'=>'shop',
+        'action'=>'',
+        'routePath'=>'shop',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'商品列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'index', 'routePath'=>'shop/index', 'show'=>1,],
+            // 新添加的商品操作  --- stat
+            ['name'=>'添加商品', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'goods-add', 'routePath'=>'shop/goods-add', 'show'=>0,],
+            ['name'=>'编辑商品', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'goods-edit', 'routePath'=>'shop/goods-edit', 'show'=>0,],
+            ['name'=>'删除商品', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'goods-delete', 'routePath'=>'shop/goods-delete', 'show'=>0,],
+            // 新添加的商品操作 ---stop
+            ['name'=>'商品列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'goods-list-export', 'routePath'=>'shop/goods-list-export', 'show'=>0,],
+            ['name'=>'套餐管理', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'package', 'routePath'=>'shop/package', 'show'=>1,],
+            ['name'=>'报单列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'dec-order-list', 'routePath'=>'shop/dec-order-list', 'show'=>1,],
+            ['name'=>'报单列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'dec-order-list-export', 'routePath'=>'shop/dec-order-list-export', 'show'=>0,],
+            ['name'=>'订单列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-list', 'routePath'=>'shop/order-list', 'show'=>1,],
+            ['name'=>'订单列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-list-export', 'routePath'=>'shop/order-list-export', 'show'=>0,],
+            ['name'=>'订单发货', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-delivery', 'routePath'=>'shop/order-delivery', 'show'=>0,],
+            ['name'=>'外部商城订单列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-shop-list', 'routePath'=>'shop/order-shop-list', 'show'=>1,],
+            ['name'=>'外部商城报单列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-dec-list', 'routePath'=>'shop/order-dec-list', 'show'=>1,],
+            ['name'=>'外部商城达标订单列表', 'class'=>'', 'icon'=>'', 'controller'=>'shop', 'action'=>'order-standard-list', 'routePath'=>'shop/order-standard-list', 'show'=>1,],
+        ]
+    ],
+    'user'=>[
+        'name'=>'会员管理',
+        'class' => '',
+        'icon'=>'el-icon-user',
+        'controller'=>'user',
+        'action'=>'',
+        'routePath'=>'user',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'会员列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'index', 'routePath'=>'user/index', 'show'=>1,],
+            ['name'=>'登录到前台', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'login-to-frontend', 'routePath'=>'user/login-to-frontend', 'show'=>0,],
+            ['name'=>'指定会员管理登录管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'batch-close-login', 'routePath'=>'user/batch-close-login', 'show'=>0,],
+            ['name'=>'按条件登录管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'close-login', 'routePath'=>'user/close-login', 'show'=>0,],
+            ['name'=>'会员地区登录管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'close-area-login', 'routePath'=>'user/close-area-login', 'show'=>0,],
+            //['name'=>'会员运作管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-operating', 'routePath'=>'user/is-operating', 'show'=>0,],
+//            ['name'=>'会员团队领导人管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-group', 'routePath'=>'user/is-group', 'show'=>0,],
+            ['name'=>'会员报单中心管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-dec', 'routePath'=>'user/is-dec', 'show'=>0,],
+            ['name'=>'会员工作室管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-studio', 'routePath'=>'user/is-studio', 'show'=>0,],
+            ['name'=>'会员转账比例修改', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'change-transfer-prop', 'routePath'=>'user/change-transfer-prop', 'show'=>0,],
+//            ['name'=>'指定会员管理报单管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'batch-close-dec', 'routePath'=>'user/batch-close-dec', 'show'=>0,],
+//            ['name'=>'按条件报单管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'close-dec', 'routePath'=>'user/close-dec', 'show'=>0,],
+//            ['name'=>'会员地区报单管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'close-area-dec', 'routePath'=>'user/close-area-dec', 'show'=>0,],
+            ['name'=>'会员列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'index-export', 'routePath'=>'user/index-export', 'show'=>0,],
+            ['name'=>'图谱管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-atlas', 'routePath'=>'user/is-atlas', 'show'=>0,],
+            ['name'=>'充值管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-recharge', 'routePath'=>'user/is-recharge', 'show'=>0,],
+            ['name'=>'修改密码', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'modify-password', 'routePath'=>'user/modify-password', 'show'=>0,],
+            ['name'=>'查看个人资料', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'profile-get', 'routePath'=>'user/profile-get', 'show'=>0,],
+            ['name'=>'修改个人资料', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'modify-profile', 'routePath'=>'user/modify-profile', 'show'=>0,],
+            ['name'=>'会员状态', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'modify-status', 'routePath'=>'user/modify-status', 'show'=>0,],
+            ['name'=>'密码修改状态', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'is-modify-password-status', 'routePath'=>'user/is-modify-password-status', 'show'=>0,],
+            ['name'=>'空单操作', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'user-add-opt', 'routePath'=>'user/user-add-opt', 'show'=>1,],
+            ['name'=>'空单添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'user-add', 'routePath'=>'user/user-add', 'show'=>0,],
+            ['name'=>'空单列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'empty-list', 'routePath'=>'user/empty-list', 'show'=>1,],
+//            ['name'=>'空单批量1导入', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'import-users-to-excel-table', 'routePath'=>'user/import-users-to-excel-table', 'show'=>0,],
+//            ['name'=>'空单批量2添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'import-users-add', 'routePath'=>'user/import-users-add', 'show'=>0,],
+//            ['name'=>'空单删除', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'user-del', 'routePath'=>'user/user-del', 'show'=>0,],
+            //['name'=>'点位绑定', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'bind', 'routePath'=>'user/bind', 'show'=>1,],
+            //['name'=>'点位绑定添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'bind-add', 'routePath'=>'user/bind-add', 'show'=>0,],
+            //['name'=>'点位绑定编辑', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'bind-edit', 'routePath'=>'user/bind-edit', 'show'=>0,],
+            //['name'=>'点位绑定撤销', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'bind-delete', 'routePath'=>'user/bind-delete', 'show'=>0,],
+            //['name'=>'点位绑定导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'bind-export', 'routePath'=>'user/bind-export', 'show'=>0,],
+            //['name'=>'点位合作', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'teamwork', 'routePath'=>'user/teamwork', 'show'=>1,],
+            //['name'=>'点位合作添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'teamwork-add', 'routePath'=>'user/teamwork-add', 'show'=>0,],
+            //['name'=>'点位合作编辑', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'teamwork-edit', 'routePath'=>'user/teamwork-edit', 'show'=>0,],
+            //['name'=>'点位合作导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'teamwork-export', 'routePath'=>'user/teamwork-export', 'show'=>0,],
+            //['name'=>'体系管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system', 'routePath'=>'user/system', 'show'=>1,],
+            //['name'=>'体系添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-add', 'routePath'=>'user/system-add', 'show'=>0,],
+            //['name'=>'体系编辑', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-edit', 'routePath'=>'user/system-edit', 'show'=>0,],
+            //['name'=>'体系撤销', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-delete', 'routePath'=>'user/system-delete', 'show'=>0,],
+            //['name'=>'体系恢复', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-renew', 'routePath'=>'user/system-renew', 'show'=>0,],
+            //['name'=>'体系导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'system-export', 'routePath'=>'user/system-export', 'show'=>0,],
+            //['name'=>'团队领导人列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'group', 'routePath'=>'user/group', 'show'=>1,],
+            //['name'=>'团队领导人列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'group-export', 'routePath'=>'user/group-export', 'show'=>0,],
+            ['name'=>'移网管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move', 'routePath'=>'user/move', 'show'=>1,],
+            ['name'=>'申请移网', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-add', 'routePath'=>'user/move-add', 'show'=>0,],
+            ['name'=>'移网修改并审核', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-pass', 'routePath'=>'user/move-pass', 'show'=>0,],
+            ['name'=>'移网审核', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-audit', 'routePath'=>'user/move-audit', 'show'=>0,],
+            ['name'=>'移网导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-export', 'routePath'=>'user/move-export', 'show'=>0,],
+            ['name'=>'移网审核删除', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'move-delete', 'routePath'=>'user/move-delete', 'show'=>0,],
+            //['name'=>'注册信息报表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info', 'routePath'=>'user/reg-info', 'show'=>1,],
+            //['name'=>'修改注册信息', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-edit', 'routePath'=>'user/reg-info-edit', 'show'=>0,],
+            //['name'=>'注册信息审核列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-audit', 'routePath'=>'user/reg-info-audit', 'show'=>1,],
+            //['name'=>'注册信息添加操作', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-audit-add-opt', 'routePath'=>'user/reg-info-audit-add-opt', 'show'=>0,],
+            //['name'=>'注册信息添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-audit-add', 'routePath'=>'user/reg-info-audit-add', 'show'=>0,],
+            //['name'=>'注册信息批量1导入', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'import-reg-info-to-excel-table', 'routePath'=>'user/import-reg-info-to-excel-table', 'show'=>0,],
+            //['name'=>'注册信息批量2添加', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'import-reg-info', 'routePath'=>'user/import-reg-info', 'show'=>0,],
+            //['name'=>'审核注册信息', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-audit-audit', 'routePath'=>'user/reg-info-audit-audit', 'show'=>0,],
+            //['name'=>'删除审核注册信息', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'reg-info-audit-delete', 'routePath'=>'user/reg-info-audit-delete', 'show'=>0,],
+            //['name'=>'会员状态管理', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'status-audit-list', 'routePath'=>'user/status-audit-list', 'show'=>1,],
+            //['name'=>'会员状态管理导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'user/status-audit-export', 'routePath'=>'user/user/status-audit-export', 'show'=>0,],
+            //['name'=>'申请修改会员状态', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'status-audit-add', 'routePath'=>'user/status-audit-add', 'show'=>0,],
+            //['name'=>'审核会员状态', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'status-audit', 'routePath'=>'user/status-audit', 'show'=>0,],
+            //['name'=>'删除审核会员状态', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'status-audit-delete', 'routePath'=>'user/status-audit-delete', 'show'=>0,],
+            ['name'=>'会员级别调整列表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'change-user-dec-level', 'routePath'=>'user/dec-level-list', 'show'=>1,],
+            ['name'=>'修改会员级别', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'change-user-dec-level', 'routePath'=>'user/change-user-dec-level', 'show'=>0,],
+            ['name'=>'修改报单中心级别', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'change-user-dec-role', 'routePath'=>'user/change-user-dec-role', 'show'=>1,],
+            //['name'=>'清空关停会员钱包', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'clear-wallet', 'routePath'=>'user/clear-wallet', 'show'=>0,],
+//            ['name'=>'会员历史年度最高聘级表', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'year-highest-emp-lv', 'routePath'=>'user/year-highest-emp-lv', 'show'=>1,],
+//            ['name'=>'会员历史年度最高聘级表导出', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'user/year-highest-emp-lv-export', 'routePath'=>'user/user/year-highest-emp-lv-export', 'show'=>0,],
+            //['name'=>'修改会员前台显示聘级', 'class'=>'', 'icon'=>'', 'controller'=>'user', 'action'=>'change-show-emp-level', 'routePath'=>'user/change-show-emp-level', 'show'=>1,],
+        ]
+    ],
+    'atlas'=>[
+        'name'=>'网络图谱',
+        'class' => '',
+        'icon'=>'el-icon-data-line',
+        'controller'=>'atlas',
+        'action'=>'',
+        'routePath'=>'atlas',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'开拓网络', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'relation-opt', 'routePath'=>'atlas/relation-opt', 'show'=>1,],
+            ['name'=>'开拓网络图', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'relation', 'routePath'=>'atlas/relation', 'show'=>0,],
+            ['name'=>'开拓网络列表', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'relation-list', 'routePath'=>'atlas/relation-list', 'show'=>0,],
+            ['name'=>'开拓网络列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'relation-list-export', 'routePath'=>'atlas/relation-list-export', 'show'=>0,],
+            ['name'=>'安置网络', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'network-opt', 'routePath'=>'atlas/network-opt', 'show'=>1,],
+            ['name'=>'安置网络图', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'network', 'routePath'=>'atlas/network', 'show'=>0,],
+            ['name'=>'安置网络列表', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'network-list', 'routePath'=>'atlas/network-list', 'show'=>0,],
+            ['name'=>'安置网络列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'atlas', 'action'=>'network-list-export', 'routePath'=>'atlas/network-list-export', 'show'=>0,],
+        ]
+    ],
+//    'reconsume'=>[
+//        'name'=>'复销管理',
+//        'class' => '',
+//        'icon'=>'el-icon-shopping-bag-1',
+//        'controller'=>'reconsume',
+//        'action'=>'',
+//        'routePath'=>'reconsume',
+//        'show'=>1,
+//        'child'=>[
+//            ['name'=>'复销池余额列表', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'pool-list', 'routePath'=>'reconsume/pool-list', 'show'=>1,],
+////            ['name'=>'手动扣除月复销', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'deduct', 'routePath'=>'reconsume/deduct', 'show'=>1,],
+//            ['name'=>'复销余额调整审核', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit-list', 'routePath'=>'reconsume/change-audit-list', 'show'=>1,],
+//            ['name'=>'复销余额调整审核导出', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit-list-export', 'routePath'=>'reconsume/change-audit-list-export', 'show'=>0,],
+//            ['name'=>'修改并通过审核余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit-pass', 'routePath'=>'reconsume/change-audit-pass', 'show'=>0,],
+//            ['name'=>'审核余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit', 'routePath'=>'reconsume/change-audit', 'show'=>0,],
+//            ['name'=>'申请余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit-add', 'routePath'=>'reconsume/change-audit-add', 'show'=>0,],
+//            ['name'=>'删除余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'change-audit-delete', 'routePath'=>'reconsume/change-audit-delete', 'show'=>0,],
+//            //['name'=>'扣除复销审核', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'deduct-audit-list', 'routePath'=>'reconsume/deduct-audit-list', 'show'=>1,],
+//            ['name'=>'手动扣除月复销', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'deduct-audit-add', 'routePath'=>'reconsume/deduct-audit-add', 'show'=>0,],
+//            ['name'=>'复销流水', 'class'=>'', 'icon'=>'', 'controller'=>'reconsume', 'action'=>'flow-list', 'routePath'=>'reconsume/flow-list', 'show'=>1,],
+//        ]
+//    ],
+    'bonus'=>[
+        'name'=>'奖金管理',
+        'class' => '',
+        'icon'=>'el-icon-coin',
+        'controller'=>'bonus',
+        'action'=>'',
+        'routePath'=>'bonus',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'封期管理', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'period', 'routePath'=>'bonus/period', 'show'=>1,],
+            ['name'=>'封期操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'close-period', 'routePath'=>'bonus/close-period', 'show'=>0,],
+            ['name'=>'生成业绩单', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-period', 'routePath'=>'bonus/perf-period', 'show'=>0,],
+            ['name'=>'结算操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'calc-period', 'routePath'=>'bonus/calc-period', 'show'=>0,],
+            ['name'=>'挂网操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'send-period', 'routePath'=>'bonus/send-period', 'show'=>0,],
+            ['name'=>'会员奖金余额', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'balance-list', 'routePath'=>'bonus/balance-list', 'show'=>1,],
+            ['name'=>'会员奖金余额导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'balance-export', 'routePath'=>'bonus/balance-export', 'show'=>0,],
+//            ['name'=>'申请发放年度奖', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'cf-lx-apply', 'routePath'=>'bonus/cf-lx-apply', 'show'=>0,],
+//            ['name'=>'年度奖金发放审核', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'cf-lx-audit-list', 'routePath'=>'bonus/cf-lx-audit-list', 'show'=>1,],
+//            ['name'=>'年度奖发放审核操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'cf-lx-audit', 'routePath'=>'bonus/cf-lx-audit', 'show'=>0,],
+            //['name'=>'期奖金明细', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'period-detail', 'routePath'=>'bonus/period-detail', 'show'=>0,],
+            ['name'=>'最新奖金', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'new-period-bonus', 'routePath'=>'bonus/new-period-bonus', 'show'=>1,],
+            ['name'=>'最新奖金导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'new-period-bonus-export', 'routePath'=>'bonus/new-period-bonus-export', 'show'=>0,],
+            ['name'=>'往期奖金', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'other-period-bonus', 'routePath'=>'bonus/other-period-bonus', 'show'=>1,],
+            ['name'=>'往期奖金导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'other-period-bonus-export', 'routePath'=>'bonus/other-period-bonus-export', 'show'=>0,],
+            ['name'=>'奖金流水', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-bonus', 'routePath'=>'bonus/flow-bonus', 'show'=>1,],
+            ['name'=>'奖金流水导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-bonus-export', 'routePath'=>'bonus/flow-bonus-export', 'show'=>0,],
+//            ['name'=>'车房养老奖流水', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-cf', 'routePath'=>'bonus/flow-cf', 'show'=>1,],
+//            ['name'=>'车房养老奖流水导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-cf-export', 'routePath'=>'bonus/flow-cf-export', 'show'=>0,],
+//            ['name'=>'领袖分红奖流水', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'flow-lx', 'routePath'=>'bonus/flow-lx', 'show'=>1,],
+//            ['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-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,],
+//            ['name'=>'区域津贴补发列表', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-list', 'routePath'=>'bonus/resend-qy-list', 'show'=>1,],
+//            ['name'=>'区域津贴补发列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-list-export', 'routePath'=>'bonus/resend-qy-list-export', 'show'=>0,],
+//            ['name'=>'申请补发区域津贴', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy', 'routePath'=>'bonus/resend-qy', 'show'=>0,],
+//            ['name'=>'补发区域津贴审核列表', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-audit-list', 'routePath'=>'bonus/resend-qy-audit-list', 'show'=>1,],
+//            ['name'=>'补发区域津贴审核列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-audit-list-export', 'routePath'=>'bonus/resend-qy-audit-list-export', 'show'=>0,],
+//            ['name'=>'补发区域津贴审核操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-audit', 'routePath'=>'bonus/resend-qy-audit', 'show'=>0,],
+//            ['name'=>'补发区域津贴审核删除', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'resend-qy-audit-delete', 'routePath'=>'bonus/resend-qy-audit-delete', 'show'=>0,],
+            ['name'=>'团队奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-qy', 'routePath'=>'bonus/trace-down-qy', 'show'=>1,],
+            ['name'=>'团队奖下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-qy-export', 'routePath'=>'bonus/trace-down-qy-export', 'show'=>0,],
+            ['name'=>'团队奖向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-qy', 'routePath'=>'bonus/trace-up-qy', 'show'=>1,],
+            ['name'=>'团队奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-qy-export', 'routePath'=>'bonus/trace-up-qy-export', 'show'=>0,],
+            ['name'=>'荣衔奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-yc', 'routePath'=>'bonus/trace-down-yc', 'show'=>1,],
+            ['name'=>'荣衔奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-yc-export', 'routePath'=>'bonus/trace-down-yc-export', 'show'=>0,],
+            ['name'=>'荣衔奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-yc', 'routePath'=>'bonus/trace-up-yc', 'show'=>1,],
+            ['name'=>'荣衔奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-yc-export', 'routePath'=>'bonus/trace-up-yc-export', 'show'=>0,],
+            ['name'=>'服务奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-bd', 'routePath'=>'bonus/trace-down-bd', 'show'=>1,],
+            ['name'=>'服务奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-bd-export', 'routePath'=>'bonus/trace-down-bd-export', 'show'=>0,],
+            ['name'=>'服务奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-bd', 'routePath'=>'bonus/trace-up-bd', 'show'=>1,],
+            ['name'=>'服务奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-bd-export', 'routePath'=>'bonus/trace-up-bd-export', 'show'=>0,],
+            ['name'=>'推广奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-tg', 'routePath'=>'bonus/trace-down-tg', 'show'=>1,],
+            ['name'=>'推广奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-tg-export', 'routePath'=>'bonus/trace-down-tg-export', 'show'=>0,],
+            ['name'=>'推广奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-tg', 'routePath'=>'bonus/trace-up-tg', 'show'=>1,],
+            ['name'=>'推广奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-tg-export', 'routePath'=>'bonus/trace-up-tg-export', 'show'=>0,],
+            ['name'=>'消费奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-xf', 'routePath'=>'bonus/trace-down-xf', 'show'=>1,],
+            ['name'=>'消费奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-xf-export', 'routePath'=>'bonus/trace-down-xf-export', 'show'=>0,],
+            ['name'=>'消费奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-xf', 'routePath'=>'bonus/trace-up-xf', 'show'=>1,],
+            ['name'=>'消费奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-xf-export', 'routePath'=>'bonus/trace-up-xf-export', 'show'=>0,],
+            ['name'=>'业绩奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-yj', 'routePath'=>'bonus/trace-down-yj', 'show'=>1,],
+            ['name'=>'业绩奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-yj-export', 'routePath'=>'bonus/trace-down-yj-export', 'show'=>0,],
+            ['name'=>'业绩奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-yj', 'routePath'=>'bonus/trace-up-yj', 'show'=>1,],
+            ['name'=>'业绩奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-yj-export', 'routePath'=>'bonus/trace-up-yj-export', 'show'=>0,],
+            ['name'=>'共享奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-gx', 'routePath'=>'bonus/trace-down-gx', 'show'=>1,],
+            ['name'=>'共享奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-gx-export', 'routePath'=>'bonus/trace-down-gx-export', 'show'=>0,],
+            ['name'=>'共享奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-gx', 'routePath'=>'bonus/trace-up-gx', 'show'=>1,],
+            ['name'=>'共享奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-gx-export', 'routePath'=>'bonus/trace-up-gx-export', 'show'=>0,],
+            ['name'=>'管理奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-gl', 'routePath'=>'bonus/trace-down-gl', 'show'=>1,],
+            ['name'=>'管理奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-gl-export', 'routePath'=>'bonus/trace-down-gl-export', 'show'=>0,],
+            ['name'=>'管理奖贴向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-gl', 'routePath'=>'bonus/trace-up-gl', 'show'=>1,],
+            ['name'=>'管理奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-gl-export', 'routePath'=>'bonus/trace-up-gl-export', 'show'=>0,],
+            ['name'=>'用户业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'user-perf', 'routePath'=>'bonus/user-perf', 'show'=>1,],
+            ['name'=>'荣衔业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'yc-perf', 'routePath'=>'bonus/yc-perf', 'show'=>1,],
+            ['name'=>'达标业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-standard', 'routePath'=>'bonus/perf-standard', 'show'=>1,],
+            ['name'=>'达标业绩导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-standard-export', 'routePath'=>'bonus/perf-standard-export', 'show'=>0,],
+//            ['name'=>'复销奖向下追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-fx', 'routePath'=>'bonus/trace-down-fx', 'show'=>1,],
+//            ['name'=>'复销奖向下追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-down-fx-export', 'routePath'=>'bonus/trace-down-fx-export', 'show'=>0,],
+//            ['name'=>'复销奖向上追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-fx', 'routePath'=>'bonus/trace-up-fx', 'show'=>1,],
+//            ['name'=>'复销奖向上追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-up-fx-export', 'routePath'=>'bonus/trace-up-fx-export', 'show'=>0,],
+//            ['name'=>'报单中心补贴追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-bt', 'routePath'=>'bonus/trace-bt', 'show'=>1,],
+//            ['name'=>'报单中心补贴追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-bt-export', 'routePath'=>'bonus/trace-bt-export', 'show'=>0,],
+//            ['name'=>'报单中心货补追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-fl', 'routePath'=>'bonus/trace-fl', 'show'=>1,],
+//            ['name'=>'报单中心货补追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-fl-export', 'routePath'=>'bonus/trace-fl-export', 'show'=>0,],
+//            ['name'=>'区域业绩提成追溯', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-fw', 'routePath'=>'bonus/trace-fw', 'show'=>1,],
+//            ['name'=>'区域业绩提成追溯导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'trace-fw-export', 'routePath'=>'bonus/trace-fw-export', 'show'=>0,],
+            ['name'=>'业绩单', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-order', 'routePath'=>'bonus/perf-order', 'show'=>1,],
+            ['name'=>'业绩单导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-order-export', 'routePath'=>'bonus/perf-order-export', 'show'=>0,],
+//            ['name'=>'会员实时业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'real-time-perf', 'routePath'=>'bonus/real-time-perf', 'show'=>1,],
+            ['name'=>'期业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-period-list', 'routePath'=>'bonus/perf-period-list', 'show'=>1,],
+            ['name'=>'期业绩导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-period-list-export', 'routePath'=>'bonus/perf-period-list-export', 'show'=>0,],
+            ['name'=>'月业绩', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-month', 'routePath'=>'bonus/perf-month', 'show'=>1,],
+            ['name'=>'月业绩导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-month-export', 'routePath'=>'bonus/perf-month-export', 'show'=>0,],
+            ['name'=>'月积分', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'score-month', 'routePath'=>'bonus/score-month', 'show'=>1,],
+            ['name'=>'月积分导出', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'score-month-export', 'routePath'=>'bonus/score-month-export', 'show'=>0,],
+        ]
+    ],
+    /*'report'=>[
+        'name'=>'报表管理',
+        'class' => '',
+        'icon'=>'el-icon-data-analysis',
+        'controller'=>'report',
+        'action'=>'',
+        'routePath'=>'report',
+        'show'=>1,
+        'child'=>[
+        ]
+    ],*/
+    'finance'=>[
+        'name'=>'财务管理',
+        'class' => '',
+        'icon'=>'el-icon-bank-card',
+        'controller'=>'finance',
+        'action'=>'',
+        'routePath'=>'finance',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'会员余额调整列表', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'balance-audit-list', 'routePath'=>'finance/balance-audit-list', 'show'=>1,],
+            ['name'=>'会员余额调整列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'balance-audit-list-export', 'routePath'=>'finance/balance-audit-list-export', 'show'=>0,],
+            ['name'=>'修改并通过审核余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'balance-audit-pass', 'routePath'=>'finance/balance-audit-pass', 'show'=>0,],
+            ['name'=>'审核会员余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'balance-audit', 'routePath'=>'finance/balance-audit', 'show'=>0,],
+            ['name'=>'删除审核会员余额调整', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'balance-audit-delete', 'routePath'=>'finance/balance-audit-delete', 'show'=>0,],
+            ['name'=>'申请调整会员余额操作', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'change-balance-opt', 'routePath'=>'finance/change-balance-opt', 'show'=>0,],
+            ['name'=>'申请调整会员余额', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'change-balance', 'routePath'=>'finance/change-balance', 'show'=>0,],
+            ['name'=>'申请调整会员余额批量1导入', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'import-change-balance-to-excel-table', 'routePath'=>'finance/import-change-balance-to-excel-table', 'show'=>0,],
+            ['name'=>'申请调整会员余额批量2添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'import-change-balance', 'routePath'=>'finance/import-change-balance', 'show'=>0,],
+//            ['name'=>'会员业绩调整列表', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-audit-list', 'routePath'=>'finance/perf-audit-list', 'show'=>1,],
+//            ['name'=>'会员业绩调整列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-audit-list-export', 'routePath'=>'finance/perf-audit-list-export', 'show'=>0,],
+            ['name'=>'修改并通过审核业绩调整', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-audit-pass', 'routePath'=>'finance/perf-audit-pass', 'show'=>0,],
+            ['name'=>'审核会员业绩调整', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-audit', 'routePath'=>'finance/perf-audit', 'show'=>0,],
+            ['name'=>'删除审核调整会员业绩', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-audit-delete', 'routePath'=>'finance/perf-audit-delete', 'show'=>0,],
+            ['name'=>'申请调整会员业绩', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'perf-apply', 'routePath'=>'finance/perf-apply', 'show'=>0,],
+            ['name'=>'转账记录列表', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'transfer-list', 'routePath'=>'finance/transfer-list', 'show'=>1,],
+            ['name'=>'转账记录列表导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'transfer-list-export', 'routePath'=>'finance/transfer-list-export', 'show'=>0,],
+            ['name'=>'提现管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw', 'routePath'=>'finance/withdraw', 'show'=>1,],
+//            ['name'=>'提现管理-待传发票', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-0', 'routePath'=>'finance/withdraw-0', 'show'=>0,],
+//            ['name'=>'提现管理-提现待审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-0', 'routePath'=>'finance/withdraw-0', 'show'=>0,],
+//            ['name'=>'提现管理-提现已审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-2', 'routePath'=>'finance/withdraw-2', 'show'=>0,],
+//            ['name'=>'提现管理-提现待付款', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-3', 'routePath'=>'finance/withdraw-3', 'show'=>0,],
+//            ['name'=>'提现管理-提现已付款', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-6', 'routePath'=>'finance/withdraw-6', 'show'=>0,],
+//            ['name'=>'提现管理-付款失败', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-4', 'routePath'=>'finance/withdraw-4', 'show'=>0,],
+//            ['name'=>'提现管理-提现退回', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-7', 'routePath'=>'finance/withdraw-7', 'show'=>0,],
+            ['name'=>'审核提现信息', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-status', 'routePath'=>'finance/withdraw-status', 'show'=>0,],
+            //['name'=>'发票信息添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit-add', 'routePath'=>'finance/invoice-audit-add', 'show'=>0,],
+            //['name'=>'发票信息编辑', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit-edit', 'routePath'=>'finance/invoice-audit-edit', 'show'=>0,],
+            //['name'=>'标记付款失败批量1导入', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'import-withdraws-to-excel-table', 'routePath'=>'finance/import-withdraws-to-excel-table', 'show'=>0,],
+            //['name'=>'标记付款失败批量2添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'import-withdraws-paid-false', 'routePath'=>'finance/import-withdraws-paid-false', 'show'=>0,],
+//            ['name'=>'发票管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit', 'routePath'=>'finance/invoice-audit', 'show'=>1,],
+//            ['name'=>'发票审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit-audit', 'routePath'=>'finance/invoice-audit-audit', 'show'=>0,],
+//            ['name'=>'发票删除', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit-delete', 'routePath'=>'finance/invoice-audit-delete', 'show'=>0,],
+            //['name'=>'填写发票', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-audit-add', 'routePath'=>'finance/invoice-audit-add', 'show'=>0,],
+            //['name'=>'发票流水', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-flow', 'routePath'=>'finance/invoice-flow', 'show'=>1,],
+            //['name'=>'发票调整管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-balance-audit', 'routePath'=>'finance/invoice-balance-audit', 'show'=>1,],
+            //['name'=>'发票调整添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-balance-audit-add', 'routePath'=>'finance/invoice-balance-audit-add', 'show'=>0,],
+            ['name'=>'提现导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-export', 'routePath'=>'finance/withdraw-export', 'show'=>0,],
+            ['name'=>'交易类型管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type', 'routePath'=>'finance/deal-type', 'show'=>1,],
+            ['name'=>'交易类型添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type-add', 'routePath'=>'finance/deal-type-add', 'show'=>0,],
+            ['name'=>'交易类型修改', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type-edit', 'routePath'=>'finance/deal-type-edit', 'show'=>0,],
+            ['name'=>'历史奖金余额', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'history-bonus', 'routePath'=>'finance/history-bonus', 'show'=>1,],
+            ['name'=>'历史奖金余额导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'history-bonus-export', 'routePath'=>'finance/history-bonus-export', 'show'=>0,],
+            ['name'=>'充值管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge', 'routePath'=>'finance/recharge', 'show'=>1,],
+            ['name'=>'充值导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-export', 'routePath'=>'finance/recharge-export', 'show'=>0,],
+            //['name'=>'充值管理-充值待审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-0', 'routePath'=>'finance/recharge-0', 'show'=>0,],
+            //['name'=>'充值管理-充值已审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-1', 'routePath'=>'finance/recharge-1', 'show'=>0,],
+            //['name'=>'充值管理-充值已驳回', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-2', 'routePath'=>'finance/recharge-2', 'show'=>0,],
+            ['name'=>'审核充值信息', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-status', 'routePath'=>'finance/recharge-status', 'show'=>0,],
+        ]
+    ],
+    'article'=>[
+        'name'=>'文章管理',
+        'class' => '',
+        'icon'=>'el-icon-collection',
+        'controller'=>'article',
+        'action'=>'',
+        'routePath'=>'article',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'分类管理', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category', 'routePath'=>'article/category', 'show'=>1,],
+            ['name'=>'添加分类', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-add', 'routePath'=>'article/category-add', 'show'=>0,],
+            ['name'=>'删除分类', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-delete', 'routePath'=>'article/category-delete', 'show'=>0,],
+            ['name'=>'分类排序', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-sort', 'routePath'=>'article/category-sort', 'show'=>0,],
+            ['name'=>'文章列表', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'index', 'routePath'=>'article/index', 'show'=>1,],
+            ['name'=>'添加文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'add', 'routePath'=>'article/add', 'show'=>0,],
+            ['name'=>'编辑文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'edit', 'routePath'=>'article/edit', 'show'=>0,],
+            ['name'=>'删除文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'article-delete', 'routePath'=>'article/article-delete', 'show'=>0,],
+
+        ]
+    ],
+//    'message'=>[
+//        'name'=>'站内信管理',
+//        'class' => '',
+//        'icon'=>'fa fa-envelope-o',
+//        'controller'=>'message',
+//        'action'=>'',
+//        'routePath'=>'message',
+//        'show'=>1,
+//        'child'=>[
+//            ['name'=>'站内信列表', 'class'=>'', 'icon'=>'', 'controller'=>'message', 'action'=>'list', 'routePath'=>'message/list', 'show'=>1,],
+//            ['name'=>'添加站内信', 'class'=>'', 'icon'=>'', 'controller'=>'message', 'action'=>'add', 'routePath'=>'message/add', 'show'=>0,],
+//            ['name'=>'删除站内信', 'class'=>'', 'icon'=>'', 'controller'=>'message', 'action'=>'delete', 'routePath'=>'message/delete', 'show'=>0,],
+//        ]
+//    ],
+    'file'=>[
+        'name'=>'文件管理',
+        'class' => '',
+        'icon'=>'el-icon-files',
+        'controller'=>'file',
+        'action'=>'',
+        'routePath'=>'file',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'导出文件', 'class'=>'', 'icon'=>'', 'controller'=>'file', 'action'=>'export', 'routePath'=>'file/export', 'show'=>1,],
+            ['name'=>'删除文件', 'class'=>'', 'icon'=>'', 'controller'=>'file', 'action'=>'export-delete', 'routePath'=>'file/export-delete', 'show'=>0,],
+
+        ]
+    ],
+//    'sys' => [
+//        'name'=>'系统相关',
+//        'class' => 'list-header',
+//    ],
+    'admin'=>[
+        'name'=>'管理员管理',
+        'class' => '',
+        'icon'=>'el-icon-coordinate',
+        'controller'=>'admin',
+        'action'=>'',
+        'routePath'=>'admin',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'管理员角色列表', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role', 'routePath'=>'admin/role', 'show'=>1,],
+            ['name'=>'添加管理员角色', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role-add', 'routePath'=>'admin/role-add', 'show'=>0,],
+            ['name'=>'编辑管理员角色', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role-edit', 'routePath'=>'admin/role-edit', 'show'=>0,],
+            ['name'=>'删除管理员角色', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role-delete', 'routePath'=>'admin/role-delete', 'show'=>0,],
+            ['name'=>'管理员权限', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role-permission', 'routePath'=>'admin/role-permission', 'show'=>0,],
+            ['name'=>'管理员列表字段权限', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'role-column', 'routePath'=>'admin/role-column', 'show'=>0,],
+            ['name'=>'管理员列表', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'index', 'routePath'=>'admin/index', 'show'=>1,],
+            ['name'=>'添加管理员', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'add', 'routePath'=>'admin/add', 'show'=>0,],
+            ['name'=>'编辑管理员', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'edit', 'routePath'=>'admin/edit', 'show'=>0,],
+            ['name'=>'删除管理员', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'admin-delete', 'routePath'=>'admin/admin-delete', 'show'=>0,],
+            ['name'=>'重置密码', 'class'=>'', 'icon'=>'', 'controller'=>'admin', 'action'=>'change-password', 'routePath'=>'admin/change-password', 'show'=>1,],
+        ]
+    ],
+    'ad'=>[
+        'name'=>'广告管理',
+        'class' => '',
+        'icon'=>'el-icon-picture-outline',
+        'controller'=>'ad',
+        'action'=>'',
+        'routePath'=>'ad',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'广告位', 'class'=>'', 'icon'=>'', 'controller'=>'ad', 'action'=>'location', 'routePath'=>'ad/location', 'show'=>1,],
+            ['name'=>'广告列表', 'class'=>'', 'icon'=>'', 'controller'=>'ad', 'action'=>'list', 'routePath'=>'ad/list', 'show'=>0,],
+            ['name'=>'添加广告', 'class'=>'', 'icon'=>'', 'controller'=>'ad', 'action'=>'add', 'routePath'=>'ad/add', 'show'=>0,],
+            ['name'=>'编辑广告', 'class'=>'', 'icon'=>'', 'controller'=>'ad', 'action'=>'edit', 'routePath'=>'ad/edit', 'show'=>0,],
+            ['name'=>'删除广告', 'class'=>'', 'icon'=>'', 'controller'=>'ad', 'action'=>'ad-delete', 'routePath'=>'ad/ad-delete', 'show'=>0,],
+        ]
+    ],
+    'log'=>[
+        'name'=>'日志管理',
+        'class' => '',
+        'icon'=>'el-icon-collection',
+        'controller'=>'log',
+        'action'=>'',
+        'routePath'=>'log',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'管理员登录日志', 'class'=>'', 'icon'=>'', 'controller'=>'log', 'action'=>'admin-login', 'routePath'=>'log/admin-login', 'show'=>1,],
+            ['name'=>'会员登录日志', 'class'=>'', 'icon'=>'', 'controller'=>'log', 'action'=>'user-login', 'routePath'=>'log/user-login', 'show'=>1,],
+            ['name'=>'管理员操作日志', 'class'=>'', 'icon'=>'', 'controller'=>'log', 'action'=>'admin-handle', 'routePath'=>'log/admin-handle', 'show'=>1,],
+            ['name'=>'会员操作日志', 'class'=>'', 'icon'=>'', 'controller'=>'log', 'action'=>'user-handle', 'routePath'=>'log/user-handle', 'show'=>1,],
+            ['name'=>'系统日志', 'class'=>'', 'icon'=>'', 'controller'=>'log', 'action'=>'system', 'routePath'=>'log/system', 'show'=>1,],
+
+        ]
+    ],
+    'config' => [
+        'name'=>'设置管理',
+        'class' => '',
+        'icon'=>'el-icon-set-up',
+        'controller'=>'config',
+        'action'=>'',
+        'routePath'=>'config',
+        'show'=>1,
+        'child'=>[
+            ['name'=>'站点设置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'base', 'routePath'=>'config/base', 'show'=>1,],
+            ['name'=>'奖金设置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-opt', 'routePath'=>'config/bonus-opt', 'show'=>1,],
+            ['name'=>'奖金基本配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus', 'routePath'=>'config/bonus', 'show'=>0,],
+            ['name'=>'区域/复销奖配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-dec-level', 'routePath'=>'config/bonus-dec-level', 'show'=>0,],
+            ['name'=>'育成/车房/养老配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-emp-level', 'routePath'=>'config/bonus-emp-level', 'show'=>0,],
+            ['name'=>'期数配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'period', 'routePath'=>'config/period', 'show'=>1,],
+//            ['name'=>'会员注册类型配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'reg-type', 'routePath'=>'config/reg-type', 'show'=>1,],
+//            ['name'=>'会员注册类型编辑', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'reg-type-edit', 'routePath'=>'config/reg-type-edit', 'show'=>0,],
+//            ['name'=>'维护注册协议', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'pact-edit', 'routePath'=>'config/pact-edit', 'show'=>0,],
+            ['name'=>'第三方接口', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'api-opt', 'routePath'=>'config/api-opt', 'show'=>1,],
+            ['name'=>'OCR接口编辑', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'ocr-api-edit', 'routePath'=>'config/ocr-api-edit', 'show'=>0,],
+            ['name'=>'短信接口编辑', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'ocr-api-edit', 'routePath'=>'config/ocr-api-edit', 'show'=>0,],
+            ['name'=>'短信管理', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'sms', 'routePath'=>'config/sms', 'show'=>1,],
+            ['name'=>'积分配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'score', 'routePath'=>'config/score', 'show'=>1,],
+            ['name'=>'转账配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'transfer', 'routePath'=>'config/transfer', 'show'=>1,],
+            ['name'=>'其他配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'other', 'routePath'=>'config/other', 'show'=>1,],
+            ['name'=>'会员级别配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-level', 'routePath'=>'config/dec-level', 'show'=>1,],
+            ['name'=>'添加会员级别', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-level-add', 'routePath'=>'config/dec-level-add', 'show'=>0,],
+            ['name'=>'编辑会员级别', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-level-edit', 'routePath'=>'config/dec-level-edit', 'show'=>0,],
+            ['name'=>'会员聘级配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level', 'routePath'=>'config/emp-level', 'show'=>1,],
+            ['name'=>'添加会员聘级', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level-add', 'routePath'=>'config/emp-level-add', 'show'=>0,],
+            ['name'=>'编辑会员聘级', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level-edit', 'routePath'=>'config/emp-level-edit', 'show'=>0,],
+            ['name'=>'报单中心级别配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-role', 'routePath'=>'config/dec-role', 'show'=>1,],
+            ['name'=>'编辑报单中心级别', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-role-edit', 'routePath'=>'config/dec-role-edit', 'show'=>0,],
+        ],
+    ],
 ];

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

@@ -1,2765 +1,2765 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: leo
- * Date: 2018/2/24
- * Time: 下午12:48
- */
-
-namespace backendApi\modules\v1\controllers;
-
-use backendApi\modules\v1\models\Admin;
-use backendApi\modules\v1\models\exportForms\BonusExportForm;
-use backendApi\modules\v1\models\lists\bonus\BalanceList;
-use backendApi\modules\v1\models\lists\bonus\FlowBalanceList;
-use backendApi\modules\v1\models\lists\bonus\FlowBonusList;
-use backendApi\modules\v1\models\lists\bonus\FlowExchangePointsList;
-use backendApi\modules\v1\models\lists\bonus\FlowReconsumePointsList;
-use backendApi\modules\v1\models\lists\bonus\FlowWalletList;
-use backendApi\modules\v1\models\lists\bonus\PerfMonthList;
-use backendApi\modules\v1\models\lists\bonus\PerfOrderList;
-use backendApi\modules\v1\models\lists\bonus\PerfPeriodList;
-use backendApi\modules\v1\models\lists\bonus\PerfStandardList;
-use backendApi\modules\v1\models\lists\bonus\PeriodBonusList;
-use backendApi\modules\v1\models\lists\bonus\ScoreMonthList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownBdList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownGlList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownGxList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownQyList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownTgList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownXfList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownYcList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownYjList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpBdList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpGlList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpGxList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpQyList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpTgList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpXfList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpYcList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpYjList;
-use backendApi\modules\v1\models\lists\bonus\UserPerfList;
-use common\helpers\Cache;
-use common\helpers\Date;
-use common\helpers\Tool;
-use common\helpers\user\Info;
-use common\helpers\user\Perf;
-use common\models\CalcBonus;
-use common\models\CFLXAudit;
-use common\models\forms\ResendQYForm;
-use common\models\forms\SendCFAndLXForm;
-use common\models\PerfMonth;
-use common\models\PerfOrder;
-use common\models\PerfPeriod;
-use common\models\ResendQYAudit;
-use common\models\User;
-use common\models\UserInfo;
-use common\models\UserNetwork;
-use Yii;
-use common\helpers\Form;
-use common\models\Config;
-use common\models\FlowBonus;
-use common\models\FlowExchangePoints;
-use common\models\forms\PeriodForm;
-use common\models\Period;
-use Exception;
-
-class BonusController extends BaseController {
-    public $modelClass = FlowBonus::class;
-
-    public function behaviors() {
-        $behaviors = parent::behaviors();
-        //$behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_JSON;
-        return $behaviors;
-    }
-
-    /**
-     * 期数列表
-     * @return mixed
-     * @throws \yii\base\InvalidConfigException
-     * @throws \yii\httpclient\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionPeriod() {
-        $filter = $this->filterCondition([
-            'periodNum' => 'PERIOD_NUM',
-            'year' => 'CALC_YEAR',
-            'month' => 'CALC_MONTH',
-            'startTime' => 'START_TIME',
-            'endTime' => 'END_TIME',
-            'closedAt' => 'CLOSED_AT',
-            'perfStartedAt' => 'PERF_STARTED_AT',
-            'perfedAt' => 'PERFED_AT',
-            'calStartedAt' => 'CALCULATE_STARTED_AT',
-            'calculatedAt' => 'CALCULATED_AT',
-            'sendStartedAt' => 'SEND_STARTED_AT',
-            'sentAt' => 'SENT_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $periodObj = Period::instance();
-        $nowPeriodNum = $periodObj->getNowPeriodNum();
-        $condition .= ' AND PERIOD_NUM<=:PERIOD_NUM';
-        $params[':PERIOD_NUM'] = $nowPeriodNum;
-        $data = Period::lists($condition, $params, ['orderBy' => 'PERIOD_NUM DESC']);
-        foreach ($data['list'] as $key => $value) {
-            // 是否可封期
-            $data['list'][$key]['IS_CAN_CLOSE'] = $periodObj->isCanClose($value['PERIOD_NUM']);
-            // 是否可生成业绩单
-            $data['list'][$key]['IS_CAN_PERF'] = $periodObj->isCanPerf($value['PERIOD_NUM']);
-            // 是否可结算
-            $data['list'][$key]['IS_CAN_CALC'] = $periodObj->isCanCalc($value['PERIOD_NUM']);
-            // 是否可挂网
-            $data['list'][$key]['IS_CAN_SENT'] = $periodObj->isCanSend($value['PERIOD_NUM']);
-            // 操作数据按钮是否可用
-            $data['list'][$key]['BUTTON_IS_CAN'] = $periodObj->isCanClose($value['PERIOD_NUM']) || $periodObj->isCanPerf($value['PERIOD_NUM']) || $periodObj->isCanCalc($value['PERIOD_NUM']) || $periodObj->isCanSend($value['PERIOD_NUM']);
-        }
-        return static::notice($data);
-    }
-
-    /**
-     * 封期
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionClosePeriod() {
-        $periodNum = \Yii::$app->request->get('periodNum');
-        if (!$periodNum) {
-            return static::notice('期数不存在', 400);
-        }
-        $formModel = new PeriodForm();
-        if ($formModel->load(Yii::$app->request->get(), '') && $formModel->closePeriod()) {
-            // Log::adminHandle('第' . $periodNum . '期封期成功');
-            return static::notice('封期成功');
-        } else {
-            return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
-        }
-    }
-
-    /**
-     * 计算业绩并生成业绩单
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionPerfPeriod() {
-        $periodNum = \Yii::$app->request->get('periodNum');
-        if (!$periodNum) {
-            return static::notice('期数不存在', 400);
-        }
-        $formModel = new PeriodForm();
-        $formModel->scenario = 'perf';
-        if ($formModel->load(Yii::$app->request->get(), '') && $formModel->perfWebToAsync()) {
-            // Log::adminHandle('第' . $periodNum . '期封生成业绩单');
-            return static::notice('生成业绩单已开始处理,请等待');
-        } else {
-            return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
-        }
-    }
-
-    /**
-     * 结算封期
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionCalcPeriod() {
-        $periodNum = \Yii::$app->request->get('periodNum');
-        if (!$periodNum) {
-            return static::notice('期数不存在', 400);
-        }
-        $formModel = new PeriodForm();
-        $formModel->scenario = 'calc';
-        if ($formModel->load(Yii::$app->request->get(), '') && $formModel->calcWebToAsync()) {
-            // Log::adminHandle('第' . $periodNum . '期结算');
-            return static::notice('结算已开始处理,请等待');
-        } else {
-            return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
-        }
-    }
-
-    /**
-     * 挂网
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionSendPeriod() {
-        $periodNum = \Yii::$app->request->get('periodNum');
-        if (!$periodNum) {
-            return static::notice('期数不存在', 400);
-        }
-        $formModel = new PeriodForm();
-        $formModel->scenario = 'send';
-        if ($formModel->load(Yii::$app->request->get(), '') && $formModel->sendWebToAsync()) {
-            // Log::adminHandle('第' . $periodNum . '期挂网');
-            return static::notice('挂网已开始处理,请等待');
-        } else {
-            return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
-        }
-    }
-
-    /**
-     * 查看业绩
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionPerf() {
-        // 获取当前年月
-        $period = Period::instance();
-        $yearMonth = $period->getNowYearMonth();
-        $yearMonth = Yii::$app->request->get('yearMonth', $yearMonth);
-        //$filter = $this->filterCondition(Perf::tableName(), ['periodNum'=>'P.PERIOD_NUM', 'userName'=>'UI.USER_NAME']);
-        $condition = '';
-        $params = [];
-        $data = PerfPeriod::lists($condition, $params, [
-            'select' => 'P.*, UI.USER_NAME',
-            'yearMonth' => $yearMonth,
-            'from' => PerfPeriod::tableName() . ' AS P',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'P.USER_ID=UI.USER_ID']
-            ],
-            'orderBy' => 'P.PERIOD_NUM DESC',
-        ]);
-        $data['request'] = [];
-        $data['request']['yearMonth'] = $yearMonth;
-        return static::notice($data);
-    }
-
-    /**
-     * 奖金流水
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowBonus() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'REAL_NAME' => 'U.REAL_NAME',
-            'IS_DEC' => 'U.IS_DEC',
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'FB.CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-//            'LAST_STATUS_NAME' => 'LAST_STATUS',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-            'TRANSFER_SN' => 'TRANSFER_SN',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new FlowBonusList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 奖金流水
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowBonusExport() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'REAL_NAME' => 'U.REAL_NAME',
-            'IS_DEC' => 'U.IS_DEC',
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'FB.CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'LAST_STATUS_NAME' => 'LAST_STATUS',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-            'TRANSFER_SN' => 'TRANSFER_SN',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '奖金流水');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 复消积分流水
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowRp() {
-        $filter = $this->filterCondition([
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new FlowReconsumePointsList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 复消积分流水导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowRpExport() {
-        $filter = $this->filterCondition([
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '复消积分流水');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-
-    /**
-     * 会员余额流水 
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowBalance() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'USER_NAME',
-            'REAL_NAME' => 'REAL_NAME',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'TRANSFER_SN' => 'TRANSFER_SN',
-            'CREATED_AT' => 'FW.CREATED_AT',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'REMARK' => 'REMARK',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new FlowBalanceList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 会员余额流水导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowBalanceExport() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'USER_NAME',
-            'REAL_NAME' => 'REAL_NAME',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'TRANSFER_SN' => 'TRANSFER_SN',
-            'CREATED_AT' => 'FW.CREATED_AT',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'REMARK' => 'REMARK',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '会员余额流水');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-
-    /**
-     * 兑换积分流水
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowExchange() {
-        $filter = $this->filterCondition([
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new FlowExchangePointsList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 兑换积分流水导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowExchangeExport() {
-        $filter = $this->filterCondition([
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '兑换积分流水');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 现金钱包流水
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowWallet() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'REAL_NAME' => 'U.REAL_NAME',
-            'IS_DEC' => 'U.IS_DEC',
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new FlowWalletList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 现金钱包流水导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowWalletExport() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'REAL_NAME' => 'U.REAL_NAME',
-            'IS_DEC' => 'U.IS_DEC',
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '现金钱包流水');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 车房流水
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowCf() {
-        $filter = $this->filterCondition([
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'LAST_STATUS_NAME' => 'LAST_STATUS',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new FlowCfList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 车房养老奖流水导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowCfExport() {
-        $filter = $this->filterCondition([
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'LAST_STATUS_NAME' => 'LAST_STATUS',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '车房养老奖流水');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 领袖分红流水
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowLx() {
-        $filter = $this->filterCondition([
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'LAST_STATUS_NAME' => 'LAST_STATUS',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new FlowLxList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionFlowLxExport() {
-        $filter = $this->filterCondition([
-            'userIds' => 'USER_ID',
-            'CREATED_AT' => 'CREATED_AT',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'CALC_MONTH' => 'CALC_MONTH',
-            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'LAST_STATUS_NAME' => 'LAST_STATUS',
-            'AMOUNT' => 'AMOUNT',
-            'TOTAL' => 'TOTAL',
-            'ADMIN_NAME' => 'ADMIN_NAME',
-            'REMARK' => 'REMARK',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '领袖分红奖流水');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 车房养老奖和领袖分红年度发放审核列表
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionCfLxAuditList() {
-        $filter = $this->filterCondition([
-            'userIds' => 'CFLXA.USER_ID',
-            'CF' => 'CFLXA.CF',
-            'LX' => 'CFLXA.LX',
-            'CREATE_ADMIN_NAME' => 'ADM.ADMIN_NAME',
-            'CREATED_AT' => 'CFLXA.CREATED_AT',
-            'AUDIT_ADMIN_NAME' => 'ADMA.ADMIN_NAME',
-            'AUDITED_AT' => 'CFLXA.AUDITED_AT',
-            'CREATE_REMARK' => 'CFLXA.CREATE_REMARK',
-            'filterStatus' => 'CFLXA.AUDIT_STATUS',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new CfLxAuditList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 车房养老奖和领袖分红年度发放审核导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionCfLxAuditExport() {
-        $filter = $this->filterCondition([
-            'userIds' => 'CFLXA.USER_ID',
-            'CF' => 'CFLXA.CF',
-            'LX' => 'CFLXA.LX',
-            'CREATE_ADMIN_NAME' => 'ADM.ADMIN_NAME',
-            'CREATED_AT' => 'CFLXA.CREATED_AT',
-            'AUDIT_ADMIN_NAME' => 'ADMA.ADMIN_NAME',
-            'AUDITED_AT' => 'CFLXA.AUDITED_AT',
-            'CREATE_REMARK' => 'CFLXA.CREATE_REMARK',
-            'filterStatus' => 'CFLXA.AUDIT_STATUS',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '年度奖金发放审核');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 申请发放车房养老奖和领袖分红
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionCfLxApply() {
-        if (Yii::$app->request->isPost) {
-            $formModel = new SendCFAndLXForm();
-            $formModel->scenario = 'apply';
-            if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->apply()) {
-                if(!empty($result['logs'])){
-                    return static::notice('申请成功,请在年度奖管理中审核');
-                }else{
-                    return static::notice('申请失败,无符合发放条件会员',400);
-                }
-            } else {
-                return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
-            }
-        }
-        return static::notice('非法请求', 400);
-    }
-
-    /**
-     * 审核车房养老奖和领袖分红
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionCfLxAudit() {
-        $formModel = new SendCFAndLXForm();
-        $formModel->scenario = 'audit';
-        if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->audit()) {
-            return static::notice('审核年度奖申请完成');
-        }
-        return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
-    }
-
-    /**
-     * 删除车房领袖审核信息
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionCfLxAuditDelete() {
-        $sendCFAndLXForm = new SendCFAndLXForm();
-        $result = static::delete(CFLXAudit::class, function ($selected) use ($sendCFAndLXForm) {
-            $sendCFAndLXForm->beforeDelete($selected);
-            // Log::adminHandle('删除审核会员余额信息');
-        }, function ($selected) use ($sendCFAndLXForm) {
-            $sendCFAndLXForm->delete($selected);
-            // Log::adminHandle('删除审核会员余额信息');
-        }, true);
-        return $result;
-    }
-
-    /**
-     * 查看所传期数的各项奖金
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionPeriodDetail() {
-        $periodNum = \Yii::$app->request->get('periodNum');
-        $period = Period::instance();
-        $periodInfo = $period->setPeriodNum($periodNum);
-        $yearMonth = $period->getYearMonth($periodNum);
-//        $filter = $this->filterCondition('UT', [
-//            'userName' => 'UI.USER_NAME',
-//        ]);
-        $condition = '';
-        $params = [];
-        $condition .= ' AND C.PERIOD_NUM=:PERIOD_NUM';
-        $params[':PERIOD_NUM'] = $periodNum;
-        if (!$period->isClosed($periodNum)) {
-            return static::notice('该期不能查看');
-        }
-        $data = CalcBonus::lists($condition, $params, [
-            'yearMonth' => $yearMonth,
-            'select' => 'C.*,UI.USER_NAME',
-            'from' => CalcBonus::tableName() . ' AS C',
-            'join' => [
-                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'C.USER_ID=UI.USER_ID'],
-            ],
-            'orderBy' => 'C.CREATED_AT DESC',
-        ]);
-        $data['periodInfo'] = $periodInfo;
-        return static::notice($data);
-    }
-
-    /**
-     * 获取最新一期结算的奖金
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionNewPeriodBonus() {
-        $periodNum = Period::calculatedMaxPeriodNum();
-        $data = $this->_periodBonus($periodNum);
-        return static::notice($data);
-    }
-
-    /**
-     * 最新一期奖金导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionNewPeriodBonusExport() {
-        $filter = $this->filterCondition([
-            'LAST_USER_NAME' => 'CB.LAST_USER_NAME',
-            'LAST_REAL_NAME' => 'CB.LAST_REAL_NAME',
-            'LAST_DEC_LV_NAME' => 'CB.LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'CB.LAST_EMP_LV',
-            'LAST_MOBILE' => 'CB.LAST_MOBILE',
-            'LAST_PERIOD_AT' => 'CB.LAST_PERIOD_AT',
-            'LAST_CREATED_AT' => 'CB.LAST_CREATED_AT',
-            'LAST_REC_USER_NAME' => 'CB.LAST_REC_USER_NAME',
-            'LAST_REC_REAL_NAME' => 'CB.LAST_REC_REAL_NAME',
-            'LAST_CON_USER_NAME' => 'CB.LAST_CON_USER_NAME',
-            'LAST_CON_REAL_NAME' => 'CB.LAST_CON_REAL_NAME',
-            'BONUS_BD' => 'CB.BONUS_BD',
-            'BONUS_TG' => 'CB.BONUS_TG',
-            'BONUS_YJ' => 'CB.BONUS_YJ',
-            'BONUS_GX' => 'CB.BONUS_GX',
-            // 'BONUS_GL' => 'CB.BONUS_BS',
-            'BONUS_GL' => 'CB.BONUS_GL',
-            'BONUS_QY' => 'CB.BONUS_QY',
-            'BONUS_YC' => 'CB.BONUS_YC',
-            'PV_1L' => 'CB.PV_1L',
-            'SURPLUS_1L' => 'CB.SURPLUS_1L',
-            'PV_2L' => 'CB.PV_2L',
-            'SURPLUS_2L' => 'CB.SURPLUS_2L',
-            'PV_3L' => 'CB.PV_3L',
-            'SURPLUS_3L' => 'CB.SURPLUS_3L',
-            'CALCULATED_AT' => 'CB.CALCULATED_AT',
-            'CALC_MONTH' => 'CB.CALC_MONTH',
-            'BONUS_QY_MONTH' => 'CB.BONUS_QY_MONTH',
-        ]);
-        $periodNum = Period::calculatedMaxPeriodNum();
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-        $filter['condition'] .= ' AND PERIOD_NUM=:PERIOD_NUM';
-        $filter['params'][':PERIOD_NUM'] = $periodNum;
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth]]), '最新奖金');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 获取往期已结算的奖金
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionOtherPeriodBonus() {
-        $periodNumRequest = \Yii::$app->request->get('periodNum');
-        if(!$periodNumRequest){
-            $periodNum = Period::calculatedMaxPeriodNum();
-            //return static::notice('请填写期数',400);
-        }else{
-            $periodNum = explode(",", $periodNumRequest)[1];
-        }
-        $data = $this->_periodBonus($periodNum,false);
-        if( isset($data['filterTypes']) && is_array($data['filterTypes']) ) {
-            $data['filterTypes'] = array_merge(['periodNum'=>['isUserTable'=> false, 'name'=> '结算期数']], $data['filterTypes']);
-        }
-
-        return static::notice($data);
-    }
-
-    /**
-     * 往期奖金导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionOtherPeriodBonusExport() {
-        $filter = $this->filterCondition([
-            'periodNum' => 'CB.PERIOD_NUM',
-            'LAST_USER_NAME' => 'CB.LAST_USER_NAME',
-            'LAST_REAL_NAME' => 'CB.LAST_REAL_NAME',
-            'LAST_DEC_LV_NAME' => 'CB.LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'CB.LAST_EMP_LV',
-            'LAST_MOBILE' => 'CB.LAST_MOBILE',
-            'LAST_PERIOD_AT' => 'CB.LAST_PERIOD_AT',
-            'LAST_CREATED_AT' => 'CB.LAST_CREATED_AT',
-            'LAST_REC_USER_NAME' => 'CB.LAST_REC_USER_NAME',
-            'LAST_REC_REAL_NAME' => 'CB.LAST_REC_REAL_NAME',
-            'LAST_CON_USER_NAME' => 'CB.LAST_CON_USER_NAME',
-            'LAST_CON_REAL_NAME' => 'CB.LAST_CON_REAL_NAME',
-            'BONUS_BD' => 'CB.BONUS_BD',
-            'BONUS_TG' => 'CB.BONUS_TG',
-            'BONUS_YJ' => 'CB.BONUS_YJ',
-            'BONUS_GX' => 'CB.BONUS_GX',
-            'BONUS_GL' => 'CB.BONUS_GL',
-            // 'BONUS_GL' => 'CB.BONUS_BS',
-            'BONUS_QY' => 'CB.BONUS_QY',
-            'BONUS_YC' => 'CB.BONUS_YC',
-            'PV_1L' => 'CB.PV_1L',
-            'SURPLUS_1L' => 'CB.SURPLUS_1L',
-            'PV_2L' => 'CB.PV_2L',
-            'SURPLUS_2L' => 'CB.SURPLUS_2L',
-            'PV_3L' => 'CB.PV_3L',
-            'SURPLUS_3L' => 'CB.SURPLUS_3L',
-            'CALCULATED_AT' => 'CB.CALCULATED_AT',
-            'CALC_MONTH' => 'CB.CALC_MONTH',
-            'BONUS_QY_MONTH' => 'CB.BONUS_QY_MONTH',
-        ]);
-        $periodNumRequest = \Yii::$app->request->get('periodNum');
-        if(!$periodNumRequest){
-            $periodNum = Period::calculatedMaxPeriodNum();
-        }else{
-            $periodNum = explode(",", $periodNumRequest)[1];
-        }
-//        if(!isset($filter['params'][':PERIODNUM'])){
-//            return static::notice('请填写期数',400);
-//        }
-//        $periodNum = $filter['params'][':PERIODNUM'];
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-//        $filter['condition'] .= ' AND CB.PERIOD_NUM=:PERIOD_NUM';
-//        $filter['params'][':PERIOD_NUM'] = $periodNum;
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth]]), '往期奖金');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 获取筛选类型
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionOtherPeriodBonusFilterTypes(){
-        $listObj = new PeriodBonusList();
-        $filterTypes = $listObj->getFilterTypes();
-        $filterTypes = array_merge(['periodNum'=>['isUserTable'=> false, 'name'=> '结算期数']], $filterTypes);
-        return static::notice($filterTypes);
-    }
-
-    /**
-     * 期数对应的奖金
-     * @param $periodNum
-     * @param $periodFilter
-     * @return array
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     */
-    private function _periodBonus($periodNum,$periodFilter = true) {
-        $filter = $this->filterCondition([
-            'periodNum' => 'CB.PERIOD_NUM',
-            'LAST_USER_NAME' => 'CB.LAST_USER_NAME',
-            'LAST_REAL_NAME' => 'CB.LAST_REAL_NAME',
-            'LAST_DEC_LV_NAME' => 'CB.LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'CB.LAST_EMP_LV',
-            'LAST_MOBILE' => 'CB.LAST_MOBILE',
-            'LAST_PERIOD_AT' => 'CB.LAST_PERIOD_AT',
-            'LAST_CREATED_AT' => 'CB.LAST_CREATED_AT',
-            'LAST_REC_USER_NAME' => 'CB.LAST_REC_USER_NAME',
-            'LAST_REC_REAL_NAME' => 'CB.LAST_REC_REAL_NAME',
-            'LAST_CON_USER_NAME' => 'CB.LAST_CON_USER_NAME',
-            'LAST_CON_REAL_NAME' => 'CB.LAST_CON_REAL_NAME',
-            'BONUS_BD' => 'CB.BONUS_BD',
-            'BONUS_TG' => 'CB.BONUS_TG',
-            'BONUS_XF' => 'CB.BONUS_XF',
-            'BONUS_YJ' => 'CB.BONUS_YJ',
-            'BONUS_GX' => 'CB.BONUS_GX',
-            'BONUS_GL' => 'CB.BONUS_GL',
-            // 'BONUS_GL' => 'CB.BONUS_BS',
-            'BONUS_QY' => 'CB.BONUS_QY',
-            'BONUS_YC' => 'CB.BONUS_YC',
-            'ORI_BONUS_STANDARD' => 'CB.ORI_BONUS_STANDARD',
-            'PV_1L' => 'CB.PV_1L',
-            'SURPLUS_1L' => 'CB.SURPLUS_1L',
-            'PV_2L' => 'CB.PV_2L',
-            'SURPLUS_2L' => 'CB.SURPLUS_2L',
-            'PV_3L' => 'CB.PV_3L',
-            'SURPLUS_3L' => 'CB.SURPLUS_3L',
-            'CALCULATED_AT' => 'CB.CALCULATED_AT',
-            'CALC_MONTH' => 'CB.CALC_MONTH',
-            'BONUS_QY_MONTH' => 'CB.BONUS_QY_MONTH',
-        ]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        if($periodFilter){
-            $condition .= ' AND CB.PERIOD_NUM=:PERIOD_NUM';
-            $params[':PERIOD_NUM'] = $periodNum;
-        }
-        $listObj = new PeriodBonusList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth]]);
-        return $data;
-    }
-
-    /**
-     * 团队奖奖金向下追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownQy() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice('请填写期数', 400);
-        $userName = Yii::$app->request->get('userName');
-        if (!$userName) return static::notice('请填写会员编号', 400);
-        $period = Period::instance();
-        if (!$period->isCalculated($periodNum)) {
-            return static::notice([]);
-        }
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'decType' => 'PO.DEC_TYPE',
-            'periodNum' => 'PO.PERIOD_NUM',
-        ]);
-        $qyFilter = $this->_qyFilterCondition($filter['request']);
-        $filter = array_merge($filter, $qyFilter);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new TraceDownQyList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-        return static::notice($data);
-    }
-
-    /**
-     * 获取
-     * @param $request
-     * @return array|string[]
-     */
-    private function _qyFilterCondition($request) {
-        //根据USER_NAME获取USER_ID
-        $user = User::find()->select('ID')->where('USER_NAME=:USER_NAME', ['USER_NAME'=>$request['userName']])->asArray()->one();
-        if( !$user ) return [];
-
-        //找到这个会员的LOCATION_TAG
-        $userNetwork = UserNetwork::find()->select(['LOCATION_TAG'])->where('USER_ID=:USER_ID', ['USER_ID'=>$user['ID']])->asArray()->one();
-        $searchLocationTag = $userNetwork['LOCATION_TAG'];
-        if( isset($request['location']) && $request['location'] ) {
-            $searchLocationTag .= $request['location'];
-        }
-
-        return [
-            'LOCATION_TAG' => 'LIKE ' . $searchLocationTag . '%'
-        ];
-    }
-
-    /**
-     * 团队奖向下追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownQyExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice('请填写期数', 400);
-        $userName = Yii::$app->request->get('userName');
-        if (!$userName) return static::notice('请填写会员编号', 400);
-        $period = Period::instance();
-        if (!$period->isCalculated($periodNum)) {
-            return static::notice([]);
-        }
-        $yearMonth = $period->getYearMonth($periodNum);
-        $filter = $this->filterCondition([
-            'decType' => 'PO.DEC_TYPE',
-            'periodNum' => 'PO.PERIOD_NUM',
-        ]);
-        $qyFilter = $this->_qyFilterCondition($filter['request']);
-        $filter = array_merge($filter, $qyFilter);
-
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '团队奖向下追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 团队奖向上追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpQy() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice('请填写期数', 400);
-        if (!$userName = Yii::$app->request->get('userName')) return static::notice('请填写会员编号', 400);
-        if(!$userId = Info::getUserIdByUserName($userName))  return static::notice('会员不存在', 400);
-        //会员是否有业绩单
-        if(!PerfOrder::find()->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM',[':USER_ID'=>$userId,':PERIOD_NUM'=>$periodNum])->exists()){
-            return static::notice('该会员本期没有业绩单', 400);
-        }
-        $listObj = new TraceUpQyList();
-        $data = $listObj->getList(['condition'=>'', 'params'=>[], 'others'=>['userId'=>$userId, 'periodNum'=>$periodNum]]);
-        return static::notice($data);
-    }
-
-    /**
-     * 团队奖向上追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpQyExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice('请填写期数', 400);
-        if (!$userName = Yii::$app->request->get('userName')) return static::notice('请填写会员编号', 400);
-        if(!$userId = Info::getUserIdByUserName($userName))  return static::notice('会员不存在', 400);
-        //会员是否有业绩单
-        if(!PerfOrder::find()->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM',[':USER_ID'=>$userId,':PERIOD_NUM'=>$periodNum])->exists()){
-            return static::notice('该会员本期没有业绩单', 400);
-        }
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge(['condition'=>'', 'params'=>[]], ['others'=>['userId'=>$userId, 'periodNum'=>$periodNum]]), '团队奖向上追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 荣衔奖向下追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownYc() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBY.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceDownYcList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 荣衔奖向下追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownYcExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBY.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向下追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 服务奖向下追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownBd() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBB.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceDownBdList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 服务奖向下追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownBdExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBB.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '服务奖向下追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-
-    /**
-     * 推广奖向下追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownTg() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CTG.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceDownTgList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 推广奖向下追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownTgExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CTG.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '推广奖向下追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 消费奖向下追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownXf() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CXF.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceDownXfList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 消费奖向下追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownXfExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CXF.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '推广奖向下追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 业绩奖向下追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownYj() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CYJ.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceDownYjList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 业绩奖向下追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownYjExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CYJ.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '业绩奖向下追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 共享奖向下追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownGx() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CGX.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceDownGxList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 共享奖向下追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownGxExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CGX.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '共享奖向下追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 管理奖向下追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownGl() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CGL.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceDownGlList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 管理奖向下追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownGlExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CGL.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '管理奖向下追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 荣衔奖向上追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpYc() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBY.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceUpYcList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 荣衔奖向上追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpYcExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBY.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-
-    /**
-     * 服务奖向上追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpBd() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBB.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceUpBdList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 服务奖向上追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpBdExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBY.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 推广奖向上追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpTg() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CTG.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceUpTgList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 推广奖向上追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpTgExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CTG.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 消费奖向上追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpXf() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CXF.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceUpXfList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 推广奖向上追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpXfExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CXF.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 业绩奖向上追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpYj() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CYJ.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceUpYjList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 业绩奖向上追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpYjExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CYJ.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 共享奖向上追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpGx() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CGX.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceUpGxList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 共享奖向上追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpGxExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CGX.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 管理奖向上追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpGl() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CGL.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceUpGlList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 管理奖向上追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpGlExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CGL.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-
-    /**
-     * 复销奖向下追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownFx() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBF.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceDownFxList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 复销奖向下追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceDownFxExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBF.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '复销奖向下追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 复销奖向上追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpFx() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBF.PERIOD_NUM',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-
-        $listObj = new TraceUpFxList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 复销奖向上追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceUpFxExport() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        if (!$periodNum) return static::notice([]);
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-            'periodNum' => 'CBF.PERIOD_NUM',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '复销奖向上追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 核算会员区域津贴
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionCalcQy() {
-        $periodNum = Yii::$app->request->get('periodNum');
-        $userName = Yii::$app->request->get('userName');
-        $period = Period::instance();
-        $yearMonth = $period->getYearMonth($periodNum);
-        if (!$userId = Info::getUserIdByUserName($userName)) {
-            return static::notice('会员不存在', 400);
-        }
-        $data = CalcBonus::findUseSlaves()->yearMonth($yearMonth)->where('PERIOD_NUM=:PERIOD_NUM AND USER_ID=:USER_ID', [':PERIOD_NUM' => $periodNum, ':USER_ID' => $userId])->asArray()->one();
-        if ($data) {
-            $data['REAL_NAME'] = Info::getUserRealNameByUserId($userId);
-            $data['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$data['LAST_DEC_LV']]['LEVEL_NAME']??'';
-            $data['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$data['LAST_EMP_LV']]['LEVEL_NAME']??'';
-            $data['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$data['LAST_STATUS']]['label']??'';
-            $data['AUDIT_STATUS'] = false;
-            if ($resendQy = ResendQYAudit::find()->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM AND (AUDIT_STATUS=:AUDIT_STATUS_UN OR AUDIT_STATUS=:AUDIT_STATUS_TRUE)', [':USER_ID' => $userId, ':PERIOD_NUM' => $periodNum, ':AUDIT_STATUS_UN' => \Yii::$app->params['auditStatus']['un']['value'], ':AUDIT_STATUS_TRUE' => \Yii::$app->params['auditStatus']['true']['value']])->asArray()->one()) {
-                $data['AUDIT_STATUS'] = $resendQy['AUDIT_STATUS'];
-            }
-        }
-        return static::notice($data);
-    }
-
-    /**
-     * 补发区域津贴列表
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionResendQyList() {
-        $filter = $this->filterCondition([
-            'userIds' => 'USER_ID',
-            'filterStatus' => 'RESEND_STATUS',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'LAST_STATUS_NAME' => 'LAST_STATUS',
-            'LAST_SUB_COM_NAME' => 'LAST_SUB_COM_ID',
-            'LAST_AREA_NAME' => [
-                'FIELD' => ['LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY'],
-                'BIND' => ['LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY'],
-            ],
-            'LAST_SYSTEM_NAME' => 'LAST_SYSTEM_ID',
-            'BONUS_QY' => 'BONUS_QY',
-            'SHOULD_QY' => 'SHOULD_QY',
-            'QY_1L' => 'QY_1L',
-            'SURPLUS_1L' => 'SURPLUS_1L',
-            'QY_2L' => 'QY_2L',
-            'SURPLUS_2L' => 'SURPLUS_2L',
-            'QY_3L' => 'QY_3L',
-            'SURPLUS_3L' => 'SURPLUS_3L',
-            'QY_4L' => 'QY_4L',
-            'SURPLUS_4L' => 'SURPLUS_4L',
-            'QY_5L' => 'QY_5L',
-            'SURPLUS_5L' => 'SURPLUS_5L',
-            'SURPLUS_LS' => 'SURPLUS_LS',
-            'QY_LS' => 'QY_LS',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new ResendQyList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 区域津贴补发列表导出 
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionResendQyListExport() {
-        $filter = $this->filterCondition([
-            'userIds' => 'USER_ID',
-            'filterStatus' => 'RESEND_STATUS',
-            'PERIOD_NUM' => 'PERIOD_NUM',
-            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
-            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
-            'LAST_STATUS_NAME' => 'LAST_STATUS',
-            'LAST_SUB_COM_NAME' => 'LAST_SUB_COM_ID',
-            'LAST_AREA_NAME' => [
-                'FIELD' => ['LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY'],
-                'BIND' => ['LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY'],
-            ],
-            'LAST_SYSTEM_NAME' => 'LAST_SYSTEM_ID',
-            'BONUS_QY' => 'BONUS_QY',
-            'SHOULD_QY' => 'SHOULD_QY',
-            'QY_1L' => 'QY_1L',
-            'SURPLUS_1L' => 'SURPLUS_1L',
-            'QY_2L' => 'QY_2L',
-            'SURPLUS_2L' => 'SURPLUS_2L',
-            'QY_3L' => 'QY_3L',
-            'SURPLUS_3L' => 'SURPLUS_3L',
-            'QY_4L' => 'QY_4L',
-            'SURPLUS_4L' => 'SURPLUS_4L',
-            'QY_5L' => 'QY_5L',
-            'SURPLUS_5L' => 'SURPLUS_5L',
-            'SURPLUS_LS' => 'SURPLUS_LS',
-            'QY_LS' => 'QY_LS',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '区域津贴补发列表');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 补发区域津贴
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionResendQy() {
-        if (Yii::$app->request->isPost) {
-            $formModel = new ResendQYForm();
-            $formModel->scenario = 'apply';
-            if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->apply()) {
-                if($result['logs']){
-                    /*foreach ($result['logs'] as $k => $value) {
-                        $userName = Info::getUserNameByUserId($value);
-                        // Log::adminHandle('申请为会员' . $userName . '发放补发区域津贴', 0, $value, $userName);
-                    }*/
-                    return static::notice('申请成功,请在补发区域津贴审核管理中审核');
-                }else{
-                    return static::notice('没有符合补发条件的记录',400);
-                }
-            } else {
-                return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
-            }
-        }
-        return static::notice('非法请求', 400);
-    }
-
-    /**
-     * 补发审核表
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionResendQyAuditList() {
-        $filter = $this->filterCondition([
-            'userIds' => 'RQYA.USER_ID',
-            'filterStatus' => 'RQYA.AUDIT_STATUS',
-            'SHOULD_BONUS' => 'RQYA.SHOULD_BONUS',
-            'PERIOD_NUM' => 'RQYA.PERIOD_NUM',
-            'CREATED_AT' => 'RQYA.CREATED_AT',
-            'AUDITED_AT' => 'RQYA.AUDITED_AT',
-            'RESEND_REMARK' => 'RQYA.RESEND_REMARK',
-            'CREATE_ADMIN_NAME' => 'ADMC.ADMIN_NAME',
-            'AUDIT_ADMIN_NAME' => 'ADMA.ADMIN_NAME',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new ResendQyAuditList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 补发审核表导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionResendQyAuditListExport() {
-        $filter = $this->filterCondition([
-            'userIds' => 'RQYA.USER_ID',
-            'filterStatus' => 'RQYA.AUDIT_STATUS',
-            'SHOULD_BONUS' => 'RQYA.SHOULD_BONUS',
-            'PERIOD_NUM' => 'RQYA.PERIOD_NUM',
-            'CREATED_AT' => 'RQYA.CREATED_AT',
-            'AUDITED_AT' => 'RQYA.AUDITED_AT',
-            'RESEND_REMARK' => 'RQYA.RESEND_REMARK',
-            'CREATE_ADMIN_NAME' => 'ADMC.ADMIN_NAME',
-            'AUDIT_ADMIN_NAME' => 'ADMA.ADMIN_NAME',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '补发区域津贴审核列表');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 审核补发区域津贴
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionResendQyAudit() {
-        $formModel = new ResendQYForm();
-        $formModel->scenario = 'audit';
-        if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->audit()) {
-            /*foreach ($result['logs'] as $k => $value) {
-                $userName = Info::getUserNameByUserId($value);
-                // Log::adminHandle('审核为会员' . $userName . '补发区域津贴', 1, $value, $userName);
-            }*/
-            return static::notice('审核补发区域津贴成功');
-        }
-        return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
-    }
-
-    /**
-     * 删除补发区域津贴审核信息
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionResendQyAuditDelete() {
-        $resendQYForm = new ResendQYForm();
-        $result = static::delete(ResendQYAudit::class, function ($selected) use ($resendQYForm) {
-            $resendQYForm->beforeDelete($selected);
-            // Log::adminHandle('删除审核会员余额信息');
-        }, function ($selected) use ($resendQYForm) {
-            $resendQYForm->delete($selected);
-            // Log::adminHandle('删除审核会员余额信息');
-        }, true);
-        return $result;
-    }
-
-    /**
-     * 余额列表
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionBalanceList() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'UI.USER_NAME',
-            'REAL_NAME' => 'UI.REAL_NAME',
-            'userIds' => 'UB.USER_ID',
-            'BONUS' => 'BONUS',
-            'RECONSUME_POINTS' => 'RECONSUME_POINTS',
-            'CASH' => 'CASH',
-            'IS_DEC' => 'UI.IS_DEC',
-            'PERIOD_AT' => 'UI.PERIOD_AT',
-            'MOBILE' => 'UI.MOBILE',
-            'TEL' => 'UI.TEL',
-//            'CF' => 'CF',
-//            'LX' => 'LX',
-//            'HIGHEST_EMP_LV_NAME' => 'UI.HIGHEST_EMP_LV',
-//            'SYSTEM_NAME' => 'UI.SYSTEM_ID',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new BalanceList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-        return static::notice($data);
-    }
-
-    /**
-     * 会员奖金余额导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionBalanceExport() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'UI.USER_NAME',
-            'REAL_NAME' => 'UI.REAL_NAME',
-            'userIds' => 'UB.USER_ID',
-            'BONUS' => 'BONUS',
-            'IS_DEC' => 'UI.IS_DEC',
-            'PERIOD_AT' => 'UI.PERIOD_AT',
-            'MOBILE' => 'UI.MOBILE',
-            'TEL' => 'UI.TEL',
-//            'CF' => 'CF',
-//            'LX' => 'LX',
-        ]);
-        $form = new BonusExportForm();
-        $result = $form->run($filter, '会员奖金余额');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 报单中心店补/补贴追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceBt() {
-        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
-        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
-        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
-        $filterStatus = Yii::$app->request->get('filterStatus');
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        if ($startPeriodNum) {
-            $condition .= ' AND CBT.PERIOD_NUM>=:START_PERIOD_NUM';
-            $params[':START_PERIOD_NUM'] = $startPeriodNum;
-        }
-        if ($endPeriodNum) {
-            $condition .= ' AND CBT.PERIOD_NUM<=:END_PERIOD_NUM';
-            $params[':END_PERIOD_NUM'] = $endPeriodNum;
-        }
-        if ($filterStatus) {
-            $condition .= ' AND CBT.BT_TYPE=:BT_TYPE';
-            $params[':BT_TYPE'] = $filterStatus;
-        }
-        $listObj = new TraceBtList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 报单中心补贴追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceBtExport() {
-        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
-        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
-        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
-        $filterStatus = Yii::$app->request->get('filterStatus');
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        if ($startPeriodNum) {
-            $condition .= ' AND CBT.PERIOD_NUM>=:START_PERIOD_NUM';
-            $params[':START_PERIOD_NUM'] = $startPeriodNum;
-        }
-        if ($endPeriodNum) {
-            $condition .= ' AND CBT.PERIOD_NUM<=:END_PERIOD_NUM';
-            $params[':END_PERIOD_NUM'] = $endPeriodNum;
-        }
-        if ($filterStatus) {
-            $condition .= ' AND CBT.BT_TYPE=:BT_TYPE';
-            $params[':BT_TYPE'] = $filterStatus;
-        }
-        $form = new BonusExportForm();
-        $result = $form->run(['condition'=>$condition, 'params'=>$params], '报单中心补贴追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 报单中心货补追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceFl() {
-        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
-        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
-        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        if ($startPeriodNum) {
-            $condition .= ' AND CFL.PERIOD_NUM>=:START_PERIOD_NUM';
-            $params[':START_PERIOD_NUM'] = $startPeriodNum;
-        }
-        if ($endPeriodNum) {
-            $condition .= ' AND CFL.PERIOD_NUM<=:END_PERIOD_NUM';
-            $params[':END_PERIOD_NUM'] = $endPeriodNum;
-        }
-        $listObj = new TraceFlList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 报单中心货补追溯导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceFlExport() {
-        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
-        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
-        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        if ($startPeriodNum) {
-            $condition .= ' AND CFL.PERIOD_NUM>=:START_PERIOD_NUM';
-            $params[':START_PERIOD_NUM'] = $startPeriodNum;
-        }
-        if ($endPeriodNum) {
-            $condition .= ' AND CFL.PERIOD_NUM<=:END_PERIOD_NUM';
-            $params[':END_PERIOD_NUM'] = $endPeriodNum;
-        }
-        $form = new BonusExportForm();
-        $result = $form->run(['condition'=>$condition, 'params'=>$params], '报单中心货补追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 区域业绩提成追溯
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceFw() {
-        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
-        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
-        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        if ($startPeriodNum) {
-            $condition .= ' AND CFW.PERIOD_NUM>=:START_PERIOD_NUM';
-            $params[':START_PERIOD_NUM'] = $startPeriodNum;
-        }
-        if ($endPeriodNum) {
-            $condition .= ' AND CFW.PERIOD_NUM<=:END_PERIOD_NUM';
-            $params[':END_PERIOD_NUM'] = $endPeriodNum;
-        }
-        $listObj = new TraceFwList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 区域业绩提成导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionTraceFwExport() {
-        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
-        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
-        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
-        $filter = $this->filterCondition([
-            'userName' => 'UI.USER_NAME',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        if ($startPeriodNum) {
-            $condition .= ' AND CFW.PERIOD_NUM>=:START_PERIOD_NUM';
-            $params[':START_PERIOD_NUM'] = $startPeriodNum;
-        }
-        if ($endPeriodNum) {
-            $condition .= ' AND CFW.PERIOD_NUM<=:END_PERIOD_NUM';
-            $params[':END_PERIOD_NUM'] = $endPeriodNum;
-        }
-        $form = new BonusExportForm();
-        $result = $form->run(['condition'=>$condition, 'params'=>$params], '区域业绩提成追溯');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 业绩单
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionPerfOrder(){
-        $filter = $this->filterCondition([
-            'PERIOD_NUM' => 'PO.PERIOD_NUM',
-            'SN' => 'PO.SN',
-            'DEC_STATUS_NAME' => 'PO.DEC_STATUS',
-            'USER_NAME' => 'U.USER_NAME',
-            'REAL_NAME' => 'U.REAL_NAME',
-            'userIds' => 'PO.USER_ID',
-            'filterType' => 'PO.DEC_TYPE',
-            'LAST_REC_USER_NAME' => 'PO.LAST_REC_USER_NAME',
-            'LAST_REC_REAL_NAME' => 'PO.LAST_REC_REAL_NAME',
-            'PV' => 'PO.PV',
-            'DEC_AMOUNT' => 'PO.DEC_AMOUNT',
-            'DEC_SN' => 'PO.DEC_SN',
-            'CREATED_AT' => 'PO.CREATED_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new PerfOrderList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 业绩单导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionPerfOrderExport() {
-        $filter = $this->filterCondition([
-            'PERIOD_NUM' => 'PO.PERIOD_NUM',
-            'SN' => 'PO.SN',
-            'DEC_STATUS_NAME' => 'PO.DEC_STATUS',
-            'userIds' => 'PO.USER_ID',
-            'filterType' => 'PO.DEC_TYPE',
-            'LAST_REC_USER_NAME' => 'PO.LAST_REC_USER_NAME',
-            'LAST_REC_REAL_NAME' => 'PO.LAST_REC_REAL_NAME',
-            'PV' => 'PO.PV',
-            'DEC_AMOUNT' => 'PO.DEC_AMOUNT',
-            'DEC_SN' => 'PO.DEC_SN',
-            'LAST_SUB_COM_NAME' => 'PO.LAST_SUB_COM_ID',
-            'LAST_SYSTEM_NAME' => 'PO.LAST_SYSTEM_ID',
-            'LAST_AREA' => [
-                'FIELD' => ['PO.LAST_PROVINCE', 'PO.LAST_CITY', 'PO.LAST_COUNTY'],
-                'BIND' => ['LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY'],
-            ],
-            'DEC_USER_NAME' => 'DUI.USER_NAME',
-            'LAST_DEC_DEC_LV_NAME' => 'PO.LAST_DEC_DEC_LV',
-            'LAST_DEC_SUB_COM_NAME' => 'PO.LAST_DEC_SUB_COM_ID',
-            'LAST_DEC_AREA' => [
-                'FIELD' => ['PO.LAST_DEC_PROVINCE', 'PO.LAST_DEC_CITY', 'PO.LAST_DEC_COUNTY'],
-                'BIND' => ['LAST_DEC_PROVINCE', 'LAST_DEC_CITY', 'LAST_DEC_COUNTY'],
-            ],
-            'CREATED_AT' => 'PO.CREATED_AT',
-            'CLOSED_AT' => 'PO.CLOSED_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $form = new BonusExportForm();
-        $result = $form->run(['condition'=>$condition, 'params'=>$params], '业绩单');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 月积分
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionScoreMonth(){
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'userIds' => 'SM.USER_ID',
-            'CALC_MONTH' => 'SM.CALC_MONTH',
-            'CREATED_AT' => 'SM.CREATED_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new ScoreMonthList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 月积分导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionScoreMonthExport() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'userIds' => 'SM.USER_ID',
-            'CALC_MONTH' => 'SM.CALC_MONTH',
-            'CREATED_AT' => 'SM.CREATED_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $form = new BonusExportForm();
-        $result = $form->run(['condition'=>$condition, 'params'=>$params], '月积分');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 月业绩
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionPerfMonth(){
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'REC_USER_NAME' => 'RU.USER_NAME',
-            'userIds' => 'PM.USER_ID',
-            'CALC_MONTH' => 'PM.CALC_MONTH',
-            'CREATED_AT' => 'PM.CREATED_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new PerfMonthList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 月业绩导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionPerfMonthExport() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'REC_USER_NAME' => 'RU.USER_NAME',
-            'userIds' => 'PM.USER_ID',
-            'CALC_MONTH' => 'PM.CALC_MONTH',
-            'CREATED_AT' => 'PM.CREATED_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $form = new BonusExportForm();
-        $result = $form->run(['condition'=>$condition, 'params'=>$params], '月业绩');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-    /**
-     * 期业绩
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionPerfPeriodList(){
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'userIds' => 'PP.USER_ID',
-            'PERIOD_NUM' => 'PP.PERIOD_NUM',
-            'CREATED_AT' => 'PP.CREATED_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new PerfPeriodList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 期业绩导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionPerfPeriodListExport() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'userIds' => 'PP.USER_ID',
-            'PERIOD_NUM' => 'PP.PERIOD_NUM',
-            'CREATED_AT' => 'PP.CREATED_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $form = new BonusExportForm();
-        $result = $form->run(['condition'=>$condition, 'params'=>$params], '期业绩');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-
-    /**
-     * 达标业绩
-     * @return mixed
-     * @throws \yii\base\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionPerfStandard(){
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'REC_USER_NAME' => 'RU.USER_NAME',
-            'userIds' => 'PS.USER_ID',
-            'CALC_MONTH' => 'PS.CALC_MONTH',
-            'CREATED_AT' => 'PS.CREATED_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new PerfStandardList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 达标业绩导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionPerfStandardExport() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-            'REC_USER_NAME' => 'RU.USER_NAME',
-            'userIds' => 'PS.USER_ID',
-            'CALC_MONTH' => 'PS.CALC_MONTH',
-            'CREATED_AT' => 'PS.CREATED_AT',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $form = new BonusExportForm();
-        $result = $form->run(['condition'=>$condition, 'params'=>$params], '达标业绩');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
-
-
-    /**
-     * 会员实时业绩
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionRealTimePerf() {
-        $userName = Yii::$app->request->get('userName');
-        if (!$userId = Info::getUserIdByUserName($userName)) {
-            return static::notice('会员不存在', 400);
-        }
-        $period = Period::instance();
-        $newPerf = Perf::getPeriodNewPerf($userId);
-        $weekData = [['PV_1L' => $newPerf['PV_1L'], 'PV_2L' => $newPerf['PV_2L'], 'PV_3L' => $newPerf['PV_3L'], 'PV_4L' => $newPerf['PV_4L'], 'PV_5L' => $newPerf['PV_5L'], 'PV_PCS'=>Tool::formatPrice($newPerf['PV_PCS']), 'PV_PSS'=>Tool::formatPrice($newPerf['PV_PSS'])]];
-        $monthPerf = Perf::getMonthPerf($userId);
-        $monthData = [['PV_1L' => Tool::formatPrice($monthPerf['PV_1L']), 'PV_2L' => Tool::formatPrice($monthPerf['PV_2L']), 'PV_3L' => Tool::formatPrice($monthPerf['PV_3L']), 'PV_4L' => Tool::formatPrice($monthPerf['PV_4L']), 'PV_5L' => Tool::formatPrice($monthPerf['PV_5L']), 'PV_PCS'=>Tool::formatPrice($monthPerf['PV_PCS']), 'PV_PSS'=>Tool::formatPrice($monthPerf['PV_PSS'])]];
-        $lastMonth = PerfMonth::getMonthPerf($period->getLastMonth()['yearMonth'], $userId);
-        $lastData = [['PV_1L' => Tool::formatPrice($lastMonth['PV_1L_TOTAL']), 'PV_2L' => Tool::formatPrice($lastMonth['PV_2L_TOTAL']), 'PV_3L' => Tool::formatPrice($lastMonth['PV_3L_TOTAL']), 'PV_4L' => Tool::formatPrice($lastMonth['PV_4L_TOTAL']), 'PV_5L' => Tool::formatPrice($lastMonth['PV_5L_TOTAL']), 'PV_PCS'=>Tool::formatPrice($lastMonth['PV_PCS']), 'PV_PSS'=>Tool::formatPrice($lastMonth['PV_PSS']), 'PV_PSS_TOTAL'=>Tool::formatPrice($lastMonth['PV_PSS_TOTAL'])]];
-        //是否合格
-//        $lastChkStatus = '';
-//        $lastMonthPerfChk = Cache::getSystemConfig()['lastMonthPerfChk']['VALUE'];
-//        $lastArr = [$lastMonth['PV_1L_TOTAL'], $lastMonth['PV_2L_TOTAL'], $lastMonth['PV_3L_TOTAL'], $lastMonth['PV_4L_TOTAL'], $lastMonth['PV_5L_TOTAL']];
-//        if (array_sum($lastArr) >= $lastMonthPerfChk) {
-//            $lastChkStatus = '已合格';
-//        }
-        //判断大区
-//        $bigLocation = array_search(max($lastArr), $lastArr) + 1;
-        return static::notice(['weekData' => $weekData, 'monthData' => $monthData, 'lastData' => $lastData]);
-    }
-
-    /**
-     * 荣衔业绩
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionYcPerf() {
-        $userName = Yii::$app->request->get('userName');
-        if (!$userId = Info::getUserIdByUserName($userName)) {
-            return static::notice('会员不存在', 400);
-        }
-
-        $userPerfData = Perf::getUserPerf($userId);
-        $ycPerfList = [];
-        //查找推荐的子会员
-        $childrenList = UserInfo::findUseDbCalc()->select('USER_ID')->where('REC_UID=:REC_UID', [
-            'REC_UID' => $userId
-        ])->asArray()->all();
-        $maxPvPss = 0;
-        $childSumPerf = 0;
-        foreach ($childrenList as $child) {
-            $childBaseUser = Info::getBaseUserById($child['USER_ID']);
-            if( !$childBaseUser ) continue;
-            $childPerfData = Perf::getUserPerf($child['USER_ID']);
-            if( !$childPerfData ) continue;
-
-            $childPvPcs = $childPerfData['PV_PCS_ZC'] + $childPerfData['PV_PCS_FX'];
-
-            $childPvPssTotal = $childPvPcs + $childPerfData['PV_PSS'];
-
-            $childSumPerf += $childPvPssTotal;
-            if( $childPvPssTotal >= $maxPvPss ) {
-                $maxPvPss = $childPvPssTotal;
-            }
-
-            $ycPerfList[] = [
-                'USER_NAME'=>$childBaseUser['USER_NAME'],
-                'REAL_NAME'=>$childBaseUser['REAL_NAME'],
-                'PV_PCS' => $childPerfData['PV_PCS_ZC'] + $childPerfData['PV_PCS_FX'],
-                'PV_PSS_TOTAL' => $childPerfData['PV_PSS_TOTAL'],
-                'MAX_DEPART_PERF' => '-',
-                'OTHER_DEPART_PERF' => '-',
-                'PV_PSS_SUM_TOTAL' => round($childPerfData['PV_PCS_ZC'] + $childPerfData['PV_PCS_FX'] + $childPerfData['PV_PSS_TOTAL'],2),
-            ];
-        }
-
-        if( $userPerfData ) {
-            $baseUser = Info::getBaseUserById($userId);
-            $ycPerfData = [
-                'USER_NAME'=>$baseUser['USER_NAME'],
-                'REAL_NAME'=>$baseUser['REAL_NAME'],
-                'PV_PCS' => $userPerfData['PV_PCS_ZC'] + $userPerfData['PV_PCS_FX'],
-                'PV_PSS_TOTAL' => $userPerfData['PV_PSS_TOTAL'],
-                'MAX_DEPART_PERF' => round($maxPvPss, 2),
-                'OTHER_DEPART_PERF' => round($childSumPerf-$maxPvPss, 2),
-                'PV_PSS_SUM_TOTAL' => round($userPerfData['PV_PCS_ZC'] + $userPerfData['PV_PCS_FX'] + $userPerfData['PV_PSS_TOTAL'],2),
-            ];
-            array_unshift($ycPerfList, $ycPerfData);
-        }
-
-        return static::notice(['ycPerfList' => $ycPerfList]);
-    }
-
-    /**
-     * 用户业绩
-     * @return mixed
-     * @throws \yii\web\HttpException
-     */
-    public function actionUserPerf() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $listObj = new UserPerfList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
-
-        return static::notice($data);
-    }
-
-    /**
-     * 月业绩导出
-     * @return mixed
-     * @throws \yii\db\Exception
-     * @throws \yii\web\HttpException
-     */
-    public function actionUserPerfExport() {
-        $filter = $this->filterCondition([
-            'USER_NAME' => 'U.USER_NAME',
-        ]);
-        $condition = $filter['condition'];
-        $params = $filter['params'];
-        $form = new BonusExportForm();
-        $result = $form->run(['condition'=>$condition, 'params'=>$params], '用户业绩');
-        if (!$result) {
-            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
-        }
-        return static::notice('导出开始,请到文件管理-导出文件查看');
-    }
+<?php
+/**
+ * Created by PhpStorm.
+ * User: leo
+ * Date: 2018/2/24
+ * Time: 下午12:48
+ */
+
+namespace backendApi\modules\v1\controllers;
+
+use backendApi\modules\v1\models\Admin;
+use backendApi\modules\v1\models\exportForms\BonusExportForm;
+use backendApi\modules\v1\models\lists\bonus\BalanceList;
+use backendApi\modules\v1\models\lists\bonus\FlowBalanceList;
+use backendApi\modules\v1\models\lists\bonus\FlowBonusList;
+use backendApi\modules\v1\models\lists\bonus\FlowExchangePointsList;
+use backendApi\modules\v1\models\lists\bonus\FlowReconsumePointsList;
+use backendApi\modules\v1\models\lists\bonus\FlowWalletList;
+use backendApi\modules\v1\models\lists\bonus\PerfMonthList;
+use backendApi\modules\v1\models\lists\bonus\PerfOrderList;
+use backendApi\modules\v1\models\lists\bonus\PerfPeriodList;
+use backendApi\modules\v1\models\lists\bonus\PerfStandardList;
+use backendApi\modules\v1\models\lists\bonus\PeriodBonusList;
+use backendApi\modules\v1\models\lists\bonus\ScoreMonthList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownBdList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownGlList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownGxList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownQyList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownTgList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownXfList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownYcList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownYjList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpBdList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpGlList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpGxList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpQyList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpTgList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpXfList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpYcList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpYjList;
+use backendApi\modules\v1\models\lists\bonus\UserPerfList;
+use common\helpers\Cache;
+use common\helpers\Date;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\helpers\user\Perf;
+use common\models\CalcBonus;
+use common\models\CFLXAudit;
+use common\models\forms\ResendQYForm;
+use common\models\forms\SendCFAndLXForm;
+use common\models\PerfMonth;
+use common\models\PerfOrder;
+use common\models\PerfPeriod;
+use common\models\ResendQYAudit;
+use common\models\User;
+use common\models\UserInfo;
+use common\models\UserNetwork;
+use Yii;
+use common\helpers\Form;
+use common\models\Config;
+use common\models\FlowBonus;
+use common\models\FlowExchangePoints;
+use common\models\forms\PeriodForm;
+use common\models\Period;
+use Exception;
+
+class BonusController extends BaseController {
+    public $modelClass = FlowBonus::class;
+
+    public function behaviors() {
+        $behaviors = parent::behaviors();
+        //$behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_JSON;
+        return $behaviors;
+    }
+
+    /**
+     * 期数列表
+     * @return mixed
+     * @throws \yii\base\InvalidConfigException
+     * @throws \yii\httpclient\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionPeriod() {
+        $filter = $this->filterCondition([
+            'periodNum' => 'PERIOD_NUM',
+            'year' => 'CALC_YEAR',
+            'month' => 'CALC_MONTH',
+            'startTime' => 'START_TIME',
+            'endTime' => 'END_TIME',
+            'closedAt' => 'CLOSED_AT',
+            'perfStartedAt' => 'PERF_STARTED_AT',
+            'perfedAt' => 'PERFED_AT',
+            'calStartedAt' => 'CALCULATE_STARTED_AT',
+            'calculatedAt' => 'CALCULATED_AT',
+            'sendStartedAt' => 'SEND_STARTED_AT',
+            'sentAt' => 'SENT_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $periodObj = Period::instance();
+        $nowPeriodNum = $periodObj->getNowPeriodNum();
+        $condition .= ' AND PERIOD_NUM<=:PERIOD_NUM';
+        $params[':PERIOD_NUM'] = $nowPeriodNum;
+        $data = Period::lists($condition, $params, ['orderBy' => 'PERIOD_NUM DESC']);
+        foreach ($data['list'] as $key => $value) {
+            // 是否可封期
+            $data['list'][$key]['IS_CAN_CLOSE'] = $periodObj->isCanClose($value['PERIOD_NUM']);
+            // 是否可生成业绩单
+            $data['list'][$key]['IS_CAN_PERF'] = $periodObj->isCanPerf($value['PERIOD_NUM']);
+            // 是否可结算
+            $data['list'][$key]['IS_CAN_CALC'] = $periodObj->isCanCalc($value['PERIOD_NUM']);
+            // 是否可挂网
+            $data['list'][$key]['IS_CAN_SENT'] = $periodObj->isCanSend($value['PERIOD_NUM']);
+            // 操作数据按钮是否可用
+            $data['list'][$key]['BUTTON_IS_CAN'] = $periodObj->isCanClose($value['PERIOD_NUM']) || $periodObj->isCanPerf($value['PERIOD_NUM']) || $periodObj->isCanCalc($value['PERIOD_NUM']) || $periodObj->isCanSend($value['PERIOD_NUM']);
+        }
+        return static::notice($data);
+    }
+
+    /**
+     * 封期
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionClosePeriod() {
+        $periodNum = \Yii::$app->request->get('periodNum');
+        if (!$periodNum) {
+            return static::notice('期数不存在', 400);
+        }
+        $formModel = new PeriodForm();
+        if ($formModel->load(Yii::$app->request->get(), '') && $formModel->closePeriod()) {
+            // Log::adminHandle('第' . $periodNum . '期封期成功');
+            return static::notice('封期成功');
+        } else {
+            return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
+        }
+    }
+
+    /**
+     * 计算业绩并生成业绩单
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionPerfPeriod() {
+        $periodNum = \Yii::$app->request->get('periodNum');
+        if (!$periodNum) {
+            return static::notice('期数不存在', 400);
+        }
+        $formModel = new PeriodForm();
+        $formModel->scenario = 'perf';
+        if ($formModel->load(Yii::$app->request->get(), '') && $formModel->perfWebToAsync()) {
+            // Log::adminHandle('第' . $periodNum . '期封生成业绩单');
+            return static::notice('生成业绩单已开始处理,请等待');
+        } else {
+            return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
+        }
+    }
+
+    /**
+     * 结算封期
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionCalcPeriod() {
+        $periodNum = \Yii::$app->request->get('periodNum');
+        if (!$periodNum) {
+            return static::notice('期数不存在', 400);
+        }
+        $formModel = new PeriodForm();
+        $formModel->scenario = 'calc';
+        if ($formModel->load(Yii::$app->request->get(), '') && $formModel->calcWebToAsync()) {
+            // Log::adminHandle('第' . $periodNum . '期结算');
+            return static::notice('结算已开始处理,请等待');
+        } else {
+            return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
+        }
+    }
+
+    /**
+     * 挂网
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionSendPeriod() {
+        $periodNum = \Yii::$app->request->get('periodNum');
+        if (!$periodNum) {
+            return static::notice('期数不存在', 400);
+        }
+        $formModel = new PeriodForm();
+        $formModel->scenario = 'send';
+        if ($formModel->load(Yii::$app->request->get(), '') && $formModel->sendWebToAsync()) {
+            // Log::adminHandle('第' . $periodNum . '期挂网');
+            return static::notice('挂网已开始处理,请等待');
+        } else {
+            return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
+        }
+    }
+
+    /**
+     * 查看业绩
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionPerf() {
+        // 获取当前年月
+        $period = Period::instance();
+        $yearMonth = $period->getNowYearMonth();
+        $yearMonth = Yii::$app->request->get('yearMonth', $yearMonth);
+        //$filter = $this->filterCondition(Perf::tableName(), ['periodNum'=>'P.PERIOD_NUM', 'userName'=>'UI.USER_NAME']);
+        $condition = '';
+        $params = [];
+        $data = PerfPeriod::lists($condition, $params, [
+            'select' => 'P.*, UI.USER_NAME',
+            'yearMonth' => $yearMonth,
+            'from' => PerfPeriod::tableName() . ' AS P',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'P.USER_ID=UI.USER_ID']
+            ],
+            'orderBy' => 'P.PERIOD_NUM DESC',
+        ]);
+        $data['request'] = [];
+        $data['request']['yearMonth'] = $yearMonth;
+        return static::notice($data);
+    }
+
+    /**
+     * 奖金流水
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowBonus() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'REAL_NAME' => 'U.REAL_NAME',
+            'IS_DEC' => 'U.IS_DEC',
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'FB.CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+//            'LAST_STATUS_NAME' => 'LAST_STATUS',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+            'TRANSFER_SN' => 'TRANSFER_SN',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new FlowBonusList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 奖金流水
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowBonusExport() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'REAL_NAME' => 'U.REAL_NAME',
+            'IS_DEC' => 'U.IS_DEC',
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'FB.CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'LAST_STATUS_NAME' => 'LAST_STATUS',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+            'TRANSFER_SN' => 'TRANSFER_SN',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '奖金流水');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 复消积分流水
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowRp() {
+        $filter = $this->filterCondition([
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new FlowReconsumePointsList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 复消积分流水导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowRpExport() {
+        $filter = $this->filterCondition([
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '复消积分流水');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+
+    /**
+     * 会员余额流水 
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowBalance() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'USER_NAME',
+            'REAL_NAME' => 'REAL_NAME',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'TRANSFER_SN' => 'TRANSFER_SN',
+            'CREATED_AT' => 'FW.CREATED_AT',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'REMARK' => 'REMARK',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new FlowBalanceList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 会员余额流水导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowBalanceExport() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'USER_NAME',
+            'REAL_NAME' => 'REAL_NAME',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'TRANSFER_SN' => 'TRANSFER_SN',
+            'CREATED_AT' => 'FW.CREATED_AT',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'REMARK' => 'REMARK',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '会员余额流水');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+
+    /**
+     * 兑换点数流水
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowExchange() {
+        $filter = $this->filterCondition([
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new FlowExchangePointsList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 兑换点数流水导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowExchangeExport() {
+        $filter = $this->filterCondition([
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '兑换点数流水');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 现金钱包流水
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowWallet() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'REAL_NAME' => 'U.REAL_NAME',
+            'IS_DEC' => 'U.IS_DEC',
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new FlowWalletList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 现金钱包流水导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowWalletExport() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'REAL_NAME' => 'U.REAL_NAME',
+            'IS_DEC' => 'U.IS_DEC',
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '现金钱包流水');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 车房流水
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowCf() {
+        $filter = $this->filterCondition([
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'LAST_STATUS_NAME' => 'LAST_STATUS',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new FlowCfList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 车房养老奖流水导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowCfExport() {
+        $filter = $this->filterCondition([
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'LAST_STATUS_NAME' => 'LAST_STATUS',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '车房养老奖流水');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 领袖分红流水
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowLx() {
+        $filter = $this->filterCondition([
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'LAST_STATUS_NAME' => 'LAST_STATUS',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new FlowLxList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionFlowLxExport() {
+        $filter = $this->filterCondition([
+            'userIds' => 'USER_ID',
+            'CREATED_AT' => 'CREATED_AT',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'CALC_MONTH' => 'CALC_MONTH',
+            'DEAL_TYPE_NAME' => 'DEAL_TYPE_ID',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'LAST_STATUS_NAME' => 'LAST_STATUS',
+            'AMOUNT' => 'AMOUNT',
+            'TOTAL' => 'TOTAL',
+            'ADMIN_NAME' => 'ADMIN_NAME',
+            'REMARK' => 'REMARK',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '领袖分红奖流水');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 车房养老奖和领袖分红年度发放审核列表
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionCfLxAuditList() {
+        $filter = $this->filterCondition([
+            'userIds' => 'CFLXA.USER_ID',
+            'CF' => 'CFLXA.CF',
+            'LX' => 'CFLXA.LX',
+            'CREATE_ADMIN_NAME' => 'ADM.ADMIN_NAME',
+            'CREATED_AT' => 'CFLXA.CREATED_AT',
+            'AUDIT_ADMIN_NAME' => 'ADMA.ADMIN_NAME',
+            'AUDITED_AT' => 'CFLXA.AUDITED_AT',
+            'CREATE_REMARK' => 'CFLXA.CREATE_REMARK',
+            'filterStatus' => 'CFLXA.AUDIT_STATUS',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new CfLxAuditList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 车房养老奖和领袖分红年度发放审核导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionCfLxAuditExport() {
+        $filter = $this->filterCondition([
+            'userIds' => 'CFLXA.USER_ID',
+            'CF' => 'CFLXA.CF',
+            'LX' => 'CFLXA.LX',
+            'CREATE_ADMIN_NAME' => 'ADM.ADMIN_NAME',
+            'CREATED_AT' => 'CFLXA.CREATED_AT',
+            'AUDIT_ADMIN_NAME' => 'ADMA.ADMIN_NAME',
+            'AUDITED_AT' => 'CFLXA.AUDITED_AT',
+            'CREATE_REMARK' => 'CFLXA.CREATE_REMARK',
+            'filterStatus' => 'CFLXA.AUDIT_STATUS',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '年度奖金发放审核');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 申请发放车房养老奖和领袖分红
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionCfLxApply() {
+        if (Yii::$app->request->isPost) {
+            $formModel = new SendCFAndLXForm();
+            $formModel->scenario = 'apply';
+            if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->apply()) {
+                if(!empty($result['logs'])){
+                    return static::notice('申请成功,请在年度奖管理中审核');
+                }else{
+                    return static::notice('申请失败,无符合发放条件会员',400);
+                }
+            } else {
+                return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
+            }
+        }
+        return static::notice('非法请求', 400);
+    }
+
+    /**
+     * 审核车房养老奖和领袖分红
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionCfLxAudit() {
+        $formModel = new SendCFAndLXForm();
+        $formModel->scenario = 'audit';
+        if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->audit()) {
+            return static::notice('审核年度奖申请完成');
+        }
+        return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
+    }
+
+    /**
+     * 删除车房领袖审核信息
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionCfLxAuditDelete() {
+        $sendCFAndLXForm = new SendCFAndLXForm();
+        $result = static::delete(CFLXAudit::class, function ($selected) use ($sendCFAndLXForm) {
+            $sendCFAndLXForm->beforeDelete($selected);
+            // Log::adminHandle('删除审核会员余额信息');
+        }, function ($selected) use ($sendCFAndLXForm) {
+            $sendCFAndLXForm->delete($selected);
+            // Log::adminHandle('删除审核会员余额信息');
+        }, true);
+        return $result;
+    }
+
+    /**
+     * 查看所传期数的各项奖金
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionPeriodDetail() {
+        $periodNum = \Yii::$app->request->get('periodNum');
+        $period = Period::instance();
+        $periodInfo = $period->setPeriodNum($periodNum);
+        $yearMonth = $period->getYearMonth($periodNum);
+//        $filter = $this->filterCondition('UT', [
+//            'userName' => 'UI.USER_NAME',
+//        ]);
+        $condition = '';
+        $params = [];
+        $condition .= ' AND C.PERIOD_NUM=:PERIOD_NUM';
+        $params[':PERIOD_NUM'] = $periodNum;
+        if (!$period->isClosed($periodNum)) {
+            return static::notice('该期不能查看');
+        }
+        $data = CalcBonus::lists($condition, $params, [
+            'yearMonth' => $yearMonth,
+            'select' => 'C.*,UI.USER_NAME',
+            'from' => CalcBonus::tableName() . ' AS C',
+            'join' => [
+                ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'C.USER_ID=UI.USER_ID'],
+            ],
+            'orderBy' => 'C.CREATED_AT DESC',
+        ]);
+        $data['periodInfo'] = $periodInfo;
+        return static::notice($data);
+    }
+
+    /**
+     * 获取最新一期结算的奖金
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionNewPeriodBonus() {
+        $periodNum = Period::calculatedMaxPeriodNum();
+        $data = $this->_periodBonus($periodNum);
+        return static::notice($data);
+    }
+
+    /**
+     * 最新一期奖金导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionNewPeriodBonusExport() {
+        $filter = $this->filterCondition([
+            'LAST_USER_NAME' => 'CB.LAST_USER_NAME',
+            'LAST_REAL_NAME' => 'CB.LAST_REAL_NAME',
+            'LAST_DEC_LV_NAME' => 'CB.LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'CB.LAST_EMP_LV',
+            'LAST_MOBILE' => 'CB.LAST_MOBILE',
+            'LAST_PERIOD_AT' => 'CB.LAST_PERIOD_AT',
+            'LAST_CREATED_AT' => 'CB.LAST_CREATED_AT',
+            'LAST_REC_USER_NAME' => 'CB.LAST_REC_USER_NAME',
+            'LAST_REC_REAL_NAME' => 'CB.LAST_REC_REAL_NAME',
+            'LAST_CON_USER_NAME' => 'CB.LAST_CON_USER_NAME',
+            'LAST_CON_REAL_NAME' => 'CB.LAST_CON_REAL_NAME',
+            'BONUS_BD' => 'CB.BONUS_BD',
+            'BONUS_TG' => 'CB.BONUS_TG',
+            'BONUS_YJ' => 'CB.BONUS_YJ',
+            'BONUS_GX' => 'CB.BONUS_GX',
+            // 'BONUS_GL' => 'CB.BONUS_BS',
+            'BONUS_GL' => 'CB.BONUS_GL',
+            'BONUS_QY' => 'CB.BONUS_QY',
+            'BONUS_YC' => 'CB.BONUS_YC',
+            'PV_1L' => 'CB.PV_1L',
+            'SURPLUS_1L' => 'CB.SURPLUS_1L',
+            'PV_2L' => 'CB.PV_2L',
+            'SURPLUS_2L' => 'CB.SURPLUS_2L',
+            'PV_3L' => 'CB.PV_3L',
+            'SURPLUS_3L' => 'CB.SURPLUS_3L',
+            'CALCULATED_AT' => 'CB.CALCULATED_AT',
+            'CALC_MONTH' => 'CB.CALC_MONTH',
+            'BONUS_QY_MONTH' => 'CB.BONUS_QY_MONTH',
+        ]);
+        $periodNum = Period::calculatedMaxPeriodNum();
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+        $filter['condition'] .= ' AND PERIOD_NUM=:PERIOD_NUM';
+        $filter['params'][':PERIOD_NUM'] = $periodNum;
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth]]), '最新奖金');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 获取往期已结算的奖金
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionOtherPeriodBonus() {
+        $periodNumRequest = \Yii::$app->request->get('periodNum');
+        if(!$periodNumRequest){
+            $periodNum = Period::calculatedMaxPeriodNum();
+            //return static::notice('请填写期数',400);
+        }else{
+            $periodNum = explode(",", $periodNumRequest)[1];
+        }
+        $data = $this->_periodBonus($periodNum,false);
+        if( isset($data['filterTypes']) && is_array($data['filterTypes']) ) {
+            $data['filterTypes'] = array_merge(['periodNum'=>['isUserTable'=> false, 'name'=> '结算期数']], $data['filterTypes']);
+        }
+
+        return static::notice($data);
+    }
+
+    /**
+     * 往期奖金导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionOtherPeriodBonusExport() {
+        $filter = $this->filterCondition([
+            'periodNum' => 'CB.PERIOD_NUM',
+            'LAST_USER_NAME' => 'CB.LAST_USER_NAME',
+            'LAST_REAL_NAME' => 'CB.LAST_REAL_NAME',
+            'LAST_DEC_LV_NAME' => 'CB.LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'CB.LAST_EMP_LV',
+            'LAST_MOBILE' => 'CB.LAST_MOBILE',
+            'LAST_PERIOD_AT' => 'CB.LAST_PERIOD_AT',
+            'LAST_CREATED_AT' => 'CB.LAST_CREATED_AT',
+            'LAST_REC_USER_NAME' => 'CB.LAST_REC_USER_NAME',
+            'LAST_REC_REAL_NAME' => 'CB.LAST_REC_REAL_NAME',
+            'LAST_CON_USER_NAME' => 'CB.LAST_CON_USER_NAME',
+            'LAST_CON_REAL_NAME' => 'CB.LAST_CON_REAL_NAME',
+            'BONUS_BD' => 'CB.BONUS_BD',
+            'BONUS_TG' => 'CB.BONUS_TG',
+            'BONUS_YJ' => 'CB.BONUS_YJ',
+            'BONUS_GX' => 'CB.BONUS_GX',
+            'BONUS_GL' => 'CB.BONUS_GL',
+            // 'BONUS_GL' => 'CB.BONUS_BS',
+            'BONUS_QY' => 'CB.BONUS_QY',
+            'BONUS_YC' => 'CB.BONUS_YC',
+            'PV_1L' => 'CB.PV_1L',
+            'SURPLUS_1L' => 'CB.SURPLUS_1L',
+            'PV_2L' => 'CB.PV_2L',
+            'SURPLUS_2L' => 'CB.SURPLUS_2L',
+            'PV_3L' => 'CB.PV_3L',
+            'SURPLUS_3L' => 'CB.SURPLUS_3L',
+            'CALCULATED_AT' => 'CB.CALCULATED_AT',
+            'CALC_MONTH' => 'CB.CALC_MONTH',
+            'BONUS_QY_MONTH' => 'CB.BONUS_QY_MONTH',
+        ]);
+        $periodNumRequest = \Yii::$app->request->get('periodNum');
+        if(!$periodNumRequest){
+            $periodNum = Period::calculatedMaxPeriodNum();
+        }else{
+            $periodNum = explode(",", $periodNumRequest)[1];
+        }
+//        if(!isset($filter['params'][':PERIODNUM'])){
+//            return static::notice('请填写期数',400);
+//        }
+//        $periodNum = $filter['params'][':PERIODNUM'];
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+//        $filter['condition'] .= ' AND CB.PERIOD_NUM=:PERIOD_NUM';
+//        $filter['params'][':PERIOD_NUM'] = $periodNum;
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth]]), '往期奖金');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 获取筛选类型
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionOtherPeriodBonusFilterTypes(){
+        $listObj = new PeriodBonusList();
+        $filterTypes = $listObj->getFilterTypes();
+        $filterTypes = array_merge(['periodNum'=>['isUserTable'=> false, 'name'=> '结算期数']], $filterTypes);
+        return static::notice($filterTypes);
+    }
+
+    /**
+     * 期数对应的奖金
+     * @param $periodNum
+     * @param $periodFilter
+     * @return array
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     */
+    private function _periodBonus($periodNum,$periodFilter = true) {
+        $filter = $this->filterCondition([
+            'periodNum' => 'CB.PERIOD_NUM',
+            'LAST_USER_NAME' => 'CB.LAST_USER_NAME',
+            'LAST_REAL_NAME' => 'CB.LAST_REAL_NAME',
+            'LAST_DEC_LV_NAME' => 'CB.LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'CB.LAST_EMP_LV',
+            'LAST_MOBILE' => 'CB.LAST_MOBILE',
+            'LAST_PERIOD_AT' => 'CB.LAST_PERIOD_AT',
+            'LAST_CREATED_AT' => 'CB.LAST_CREATED_AT',
+            'LAST_REC_USER_NAME' => 'CB.LAST_REC_USER_NAME',
+            'LAST_REC_REAL_NAME' => 'CB.LAST_REC_REAL_NAME',
+            'LAST_CON_USER_NAME' => 'CB.LAST_CON_USER_NAME',
+            'LAST_CON_REAL_NAME' => 'CB.LAST_CON_REAL_NAME',
+            'BONUS_BD' => 'CB.BONUS_BD',
+            'BONUS_TG' => 'CB.BONUS_TG',
+            'BONUS_XF' => 'CB.BONUS_XF',
+            'BONUS_YJ' => 'CB.BONUS_YJ',
+            'BONUS_GX' => 'CB.BONUS_GX',
+            'BONUS_GL' => 'CB.BONUS_GL',
+            // 'BONUS_GL' => 'CB.BONUS_BS',
+            'BONUS_QY' => 'CB.BONUS_QY',
+            'BONUS_YC' => 'CB.BONUS_YC',
+            'ORI_BONUS_STANDARD' => 'CB.ORI_BONUS_STANDARD',
+            'PV_1L' => 'CB.PV_1L',
+            'SURPLUS_1L' => 'CB.SURPLUS_1L',
+            'PV_2L' => 'CB.PV_2L',
+            'SURPLUS_2L' => 'CB.SURPLUS_2L',
+            'PV_3L' => 'CB.PV_3L',
+            'SURPLUS_3L' => 'CB.SURPLUS_3L',
+            'CALCULATED_AT' => 'CB.CALCULATED_AT',
+            'CALC_MONTH' => 'CB.CALC_MONTH',
+            'BONUS_QY_MONTH' => 'CB.BONUS_QY_MONTH',
+        ]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        if($periodFilter){
+            $condition .= ' AND CB.PERIOD_NUM=:PERIOD_NUM';
+            $params[':PERIOD_NUM'] = $periodNum;
+        }
+        $listObj = new PeriodBonusList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth]]);
+        return $data;
+    }
+
+    /**
+     * 团队奖奖金向下追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownQy() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice('请填写期数', 400);
+        $userName = Yii::$app->request->get('userName');
+        if (!$userName) return static::notice('请填写会员编号', 400);
+        $period = Period::instance();
+        if (!$period->isCalculated($periodNum)) {
+            return static::notice([]);
+        }
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'decType' => 'PO.DEC_TYPE',
+            'periodNum' => 'PO.PERIOD_NUM',
+        ]);
+        $qyFilter = $this->_qyFilterCondition($filter['request']);
+        $filter = array_merge($filter, $qyFilter);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new TraceDownQyList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+        return static::notice($data);
+    }
+
+    /**
+     * 获取
+     * @param $request
+     * @return array|string[]
+     */
+    private function _qyFilterCondition($request) {
+        //根据USER_NAME获取USER_ID
+        $user = User::find()->select('ID')->where('USER_NAME=:USER_NAME', ['USER_NAME'=>$request['userName']])->asArray()->one();
+        if( !$user ) return [];
+
+        //找到这个会员的LOCATION_TAG
+        $userNetwork = UserNetwork::find()->select(['LOCATION_TAG'])->where('USER_ID=:USER_ID', ['USER_ID'=>$user['ID']])->asArray()->one();
+        $searchLocationTag = $userNetwork['LOCATION_TAG'];
+        if( isset($request['location']) && $request['location'] ) {
+            $searchLocationTag .= $request['location'];
+        }
+
+        return [
+            'LOCATION_TAG' => 'LIKE ' . $searchLocationTag . '%'
+        ];
+    }
+
+    /**
+     * 团队奖向下追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownQyExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice('请填写期数', 400);
+        $userName = Yii::$app->request->get('userName');
+        if (!$userName) return static::notice('请填写会员编号', 400);
+        $period = Period::instance();
+        if (!$period->isCalculated($periodNum)) {
+            return static::notice([]);
+        }
+        $yearMonth = $period->getYearMonth($periodNum);
+        $filter = $this->filterCondition([
+            'decType' => 'PO.DEC_TYPE',
+            'periodNum' => 'PO.PERIOD_NUM',
+        ]);
+        $qyFilter = $this->_qyFilterCondition($filter['request']);
+        $filter = array_merge($filter, $qyFilter);
+
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '团队奖向下追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 团队奖向上追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpQy() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice('请填写期数', 400);
+        if (!$userName = Yii::$app->request->get('userName')) return static::notice('请填写会员编号', 400);
+        if(!$userId = Info::getUserIdByUserName($userName))  return static::notice('会员不存在', 400);
+        //会员是否有业绩单
+        if(!PerfOrder::find()->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM',[':USER_ID'=>$userId,':PERIOD_NUM'=>$periodNum])->exists()){
+            return static::notice('该会员本期没有业绩单', 400);
+        }
+        $listObj = new TraceUpQyList();
+        $data = $listObj->getList(['condition'=>'', 'params'=>[], 'others'=>['userId'=>$userId, 'periodNum'=>$periodNum]]);
+        return static::notice($data);
+    }
+
+    /**
+     * 团队奖向上追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpQyExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice('请填写期数', 400);
+        if (!$userName = Yii::$app->request->get('userName')) return static::notice('请填写会员编号', 400);
+        if(!$userId = Info::getUserIdByUserName($userName))  return static::notice('会员不存在', 400);
+        //会员是否有业绩单
+        if(!PerfOrder::find()->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM',[':USER_ID'=>$userId,':PERIOD_NUM'=>$periodNum])->exists()){
+            return static::notice('该会员本期没有业绩单', 400);
+        }
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge(['condition'=>'', 'params'=>[]], ['others'=>['userId'=>$userId, 'periodNum'=>$periodNum]]), '团队奖向上追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 荣衔奖向下追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownYc() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBY.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceDownYcList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 荣衔奖向下追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownYcExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBY.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向下追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 服务奖向下追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownBd() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBB.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceDownBdList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 服务奖向下追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownBdExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBB.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '服务奖向下追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+
+    /**
+     * 推广奖向下追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownTg() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CTG.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceDownTgList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 推广奖向下追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownTgExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CTG.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '推广奖向下追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 消费奖向下追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownXf() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CXF.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceDownXfList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 消费奖向下追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownXfExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CXF.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '推广奖向下追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 业绩奖向下追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownYj() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CYJ.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceDownYjList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 业绩奖向下追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownYjExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CYJ.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '业绩奖向下追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 共享奖向下追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownGx() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CGX.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceDownGxList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 共享奖向下追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownGxExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CGX.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '共享奖向下追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 管理奖向下追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownGl() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CGL.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceDownGlList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 管理奖向下追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownGlExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CGL.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '管理奖向下追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 荣衔奖向上追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpYc() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBY.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceUpYcList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 荣衔奖向上追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpYcExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBY.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+
+    /**
+     * 服务奖向上追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpBd() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBB.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceUpBdList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 服务奖向上追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpBdExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBY.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 推广奖向上追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpTg() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CTG.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceUpTgList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 推广奖向上追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpTgExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CTG.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 消费奖向上追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpXf() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CXF.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceUpXfList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 推广奖向上追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpXfExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CXF.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 业绩奖向上追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpYj() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CYJ.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceUpYjList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 业绩奖向上追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpYjExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CYJ.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 共享奖向上追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpGx() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CGX.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceUpGxList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 共享奖向上追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpGxExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CGX.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 管理奖向上追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpGl() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CGL.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceUpGlList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 管理奖向上追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpGlExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CGL.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '荣衔奖向上追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+
+    /**
+     * 复销奖向下追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownFx() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBF.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceDownFxList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 复销奖向下追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceDownFxExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBF.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '复销奖向下追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 复销奖向上追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpFx() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBF.PERIOD_NUM',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+
+        $listObj = new TraceUpFxList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 复销奖向上追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceUpFxExport() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        if (!$periodNum) return static::notice([]);
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+            'periodNum' => 'CBF.PERIOD_NUM',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run(array_merge($filter, ['others'=>['yearMonth'=>$yearMonth, 'periodNum'=>$periodNum]]), '复销奖向上追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 核算会员区域津贴
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionCalcQy() {
+        $periodNum = Yii::$app->request->get('periodNum');
+        $userName = Yii::$app->request->get('userName');
+        $period = Period::instance();
+        $yearMonth = $period->getYearMonth($periodNum);
+        if (!$userId = Info::getUserIdByUserName($userName)) {
+            return static::notice('会员不存在', 400);
+        }
+        $data = CalcBonus::findUseSlaves()->yearMonth($yearMonth)->where('PERIOD_NUM=:PERIOD_NUM AND USER_ID=:USER_ID', [':PERIOD_NUM' => $periodNum, ':USER_ID' => $userId])->asArray()->one();
+        if ($data) {
+            $data['REAL_NAME'] = Info::getUserRealNameByUserId($userId);
+            $data['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$data['LAST_DEC_LV']]['LEVEL_NAME']??'';
+            $data['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$data['LAST_EMP_LV']]['LEVEL_NAME']??'';
+            $data['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$data['LAST_STATUS']]['label']??'';
+            $data['AUDIT_STATUS'] = false;
+            if ($resendQy = ResendQYAudit::find()->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM AND (AUDIT_STATUS=:AUDIT_STATUS_UN OR AUDIT_STATUS=:AUDIT_STATUS_TRUE)', [':USER_ID' => $userId, ':PERIOD_NUM' => $periodNum, ':AUDIT_STATUS_UN' => \Yii::$app->params['auditStatus']['un']['value'], ':AUDIT_STATUS_TRUE' => \Yii::$app->params['auditStatus']['true']['value']])->asArray()->one()) {
+                $data['AUDIT_STATUS'] = $resendQy['AUDIT_STATUS'];
+            }
+        }
+        return static::notice($data);
+    }
+
+    /**
+     * 补发区域津贴列表
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionResendQyList() {
+        $filter = $this->filterCondition([
+            'userIds' => 'USER_ID',
+            'filterStatus' => 'RESEND_STATUS',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'LAST_STATUS_NAME' => 'LAST_STATUS',
+            'LAST_SUB_COM_NAME' => 'LAST_SUB_COM_ID',
+            'LAST_AREA_NAME' => [
+                'FIELD' => ['LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY'],
+                'BIND' => ['LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY'],
+            ],
+            'LAST_SYSTEM_NAME' => 'LAST_SYSTEM_ID',
+            'BONUS_QY' => 'BONUS_QY',
+            'SHOULD_QY' => 'SHOULD_QY',
+            'QY_1L' => 'QY_1L',
+            'SURPLUS_1L' => 'SURPLUS_1L',
+            'QY_2L' => 'QY_2L',
+            'SURPLUS_2L' => 'SURPLUS_2L',
+            'QY_3L' => 'QY_3L',
+            'SURPLUS_3L' => 'SURPLUS_3L',
+            'QY_4L' => 'QY_4L',
+            'SURPLUS_4L' => 'SURPLUS_4L',
+            'QY_5L' => 'QY_5L',
+            'SURPLUS_5L' => 'SURPLUS_5L',
+            'SURPLUS_LS' => 'SURPLUS_LS',
+            'QY_LS' => 'QY_LS',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new ResendQyList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 区域津贴补发列表导出 
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionResendQyListExport() {
+        $filter = $this->filterCondition([
+            'userIds' => 'USER_ID',
+            'filterStatus' => 'RESEND_STATUS',
+            'PERIOD_NUM' => 'PERIOD_NUM',
+            'LAST_DEC_LV_NAME' => 'LAST_DEC_LV',
+            'LAST_EMP_LV_NAME' => 'LAST_EMP_LV',
+            'LAST_STATUS_NAME' => 'LAST_STATUS',
+            'LAST_SUB_COM_NAME' => 'LAST_SUB_COM_ID',
+            'LAST_AREA_NAME' => [
+                'FIELD' => ['LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY'],
+                'BIND' => ['LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY'],
+            ],
+            'LAST_SYSTEM_NAME' => 'LAST_SYSTEM_ID',
+            'BONUS_QY' => 'BONUS_QY',
+            'SHOULD_QY' => 'SHOULD_QY',
+            'QY_1L' => 'QY_1L',
+            'SURPLUS_1L' => 'SURPLUS_1L',
+            'QY_2L' => 'QY_2L',
+            'SURPLUS_2L' => 'SURPLUS_2L',
+            'QY_3L' => 'QY_3L',
+            'SURPLUS_3L' => 'SURPLUS_3L',
+            'QY_4L' => 'QY_4L',
+            'SURPLUS_4L' => 'SURPLUS_4L',
+            'QY_5L' => 'QY_5L',
+            'SURPLUS_5L' => 'SURPLUS_5L',
+            'SURPLUS_LS' => 'SURPLUS_LS',
+            'QY_LS' => 'QY_LS',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '区域津贴补发列表');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 补发区域津贴
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionResendQy() {
+        if (Yii::$app->request->isPost) {
+            $formModel = new ResendQYForm();
+            $formModel->scenario = 'apply';
+            if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->apply()) {
+                if($result['logs']){
+                    /*foreach ($result['logs'] as $k => $value) {
+                        $userName = Info::getUserNameByUserId($value);
+                        // Log::adminHandle('申请为会员' . $userName . '发放补发区域津贴', 0, $value, $userName);
+                    }*/
+                    return static::notice('申请成功,请在补发区域津贴审核管理中审核');
+                }else{
+                    return static::notice('没有符合补发条件的记录',400);
+                }
+            } else {
+                return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
+            }
+        }
+        return static::notice('非法请求', 400);
+    }
+
+    /**
+     * 补发审核表
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionResendQyAuditList() {
+        $filter = $this->filterCondition([
+            'userIds' => 'RQYA.USER_ID',
+            'filterStatus' => 'RQYA.AUDIT_STATUS',
+            'SHOULD_BONUS' => 'RQYA.SHOULD_BONUS',
+            'PERIOD_NUM' => 'RQYA.PERIOD_NUM',
+            'CREATED_AT' => 'RQYA.CREATED_AT',
+            'AUDITED_AT' => 'RQYA.AUDITED_AT',
+            'RESEND_REMARK' => 'RQYA.RESEND_REMARK',
+            'CREATE_ADMIN_NAME' => 'ADMC.ADMIN_NAME',
+            'AUDIT_ADMIN_NAME' => 'ADMA.ADMIN_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new ResendQyAuditList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 补发审核表导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionResendQyAuditListExport() {
+        $filter = $this->filterCondition([
+            'userIds' => 'RQYA.USER_ID',
+            'filterStatus' => 'RQYA.AUDIT_STATUS',
+            'SHOULD_BONUS' => 'RQYA.SHOULD_BONUS',
+            'PERIOD_NUM' => 'RQYA.PERIOD_NUM',
+            'CREATED_AT' => 'RQYA.CREATED_AT',
+            'AUDITED_AT' => 'RQYA.AUDITED_AT',
+            'RESEND_REMARK' => 'RQYA.RESEND_REMARK',
+            'CREATE_ADMIN_NAME' => 'ADMC.ADMIN_NAME',
+            'AUDIT_ADMIN_NAME' => 'ADMA.ADMIN_NAME',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '补发区域津贴审核列表');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 审核补发区域津贴
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionResendQyAudit() {
+        $formModel = new ResendQYForm();
+        $formModel->scenario = 'audit';
+        if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->audit()) {
+            /*foreach ($result['logs'] as $k => $value) {
+                $userName = Info::getUserNameByUserId($value);
+                // Log::adminHandle('审核为会员' . $userName . '补发区域津贴', 1, $value, $userName);
+            }*/
+            return static::notice('审核补发区域津贴成功');
+        }
+        return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
+    }
+
+    /**
+     * 删除补发区域津贴审核信息
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionResendQyAuditDelete() {
+        $resendQYForm = new ResendQYForm();
+        $result = static::delete(ResendQYAudit::class, function ($selected) use ($resendQYForm) {
+            $resendQYForm->beforeDelete($selected);
+            // Log::adminHandle('删除审核会员余额信息');
+        }, function ($selected) use ($resendQYForm) {
+            $resendQYForm->delete($selected);
+            // Log::adminHandle('删除审核会员余额信息');
+        }, true);
+        return $result;
+    }
+
+    /**
+     * 余额列表
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionBalanceList() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'UI.USER_NAME',
+            'REAL_NAME' => 'UI.REAL_NAME',
+            'userIds' => 'UB.USER_ID',
+            'BONUS' => 'BONUS',
+            'RECONSUME_POINTS' => 'RECONSUME_POINTS',
+            'CASH' => 'CASH',
+            'IS_DEC' => 'UI.IS_DEC',
+            'PERIOD_AT' => 'UI.PERIOD_AT',
+            'MOBILE' => 'UI.MOBILE',
+            'TEL' => 'UI.TEL',
+//            'CF' => 'CF',
+//            'LX' => 'LX',
+//            'HIGHEST_EMP_LV_NAME' => 'UI.HIGHEST_EMP_LV',
+//            'SYSTEM_NAME' => 'UI.SYSTEM_ID',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new BalanceList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+        return static::notice($data);
+    }
+
+    /**
+     * 会员奖金余额导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionBalanceExport() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'UI.USER_NAME',
+            'REAL_NAME' => 'UI.REAL_NAME',
+            'userIds' => 'UB.USER_ID',
+            'BONUS' => 'BONUS',
+            'IS_DEC' => 'UI.IS_DEC',
+            'PERIOD_AT' => 'UI.PERIOD_AT',
+            'MOBILE' => 'UI.MOBILE',
+            'TEL' => 'UI.TEL',
+//            'CF' => 'CF',
+//            'LX' => 'LX',
+        ]);
+        $form = new BonusExportForm();
+        $result = $form->run($filter, '会员奖金余额');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 报单中心店补/补贴追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceBt() {
+        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
+        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
+        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
+        $filterStatus = Yii::$app->request->get('filterStatus');
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        if ($startPeriodNum) {
+            $condition .= ' AND CBT.PERIOD_NUM>=:START_PERIOD_NUM';
+            $params[':START_PERIOD_NUM'] = $startPeriodNum;
+        }
+        if ($endPeriodNum) {
+            $condition .= ' AND CBT.PERIOD_NUM<=:END_PERIOD_NUM';
+            $params[':END_PERIOD_NUM'] = $endPeriodNum;
+        }
+        if ($filterStatus) {
+            $condition .= ' AND CBT.BT_TYPE=:BT_TYPE';
+            $params[':BT_TYPE'] = $filterStatus;
+        }
+        $listObj = new TraceBtList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 报单中心补贴追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceBtExport() {
+        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
+        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
+        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
+        $filterStatus = Yii::$app->request->get('filterStatus');
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        if ($startPeriodNum) {
+            $condition .= ' AND CBT.PERIOD_NUM>=:START_PERIOD_NUM';
+            $params[':START_PERIOD_NUM'] = $startPeriodNum;
+        }
+        if ($endPeriodNum) {
+            $condition .= ' AND CBT.PERIOD_NUM<=:END_PERIOD_NUM';
+            $params[':END_PERIOD_NUM'] = $endPeriodNum;
+        }
+        if ($filterStatus) {
+            $condition .= ' AND CBT.BT_TYPE=:BT_TYPE';
+            $params[':BT_TYPE'] = $filterStatus;
+        }
+        $form = new BonusExportForm();
+        $result = $form->run(['condition'=>$condition, 'params'=>$params], '报单中心补贴追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 报单中心货补追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceFl() {
+        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
+        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
+        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        if ($startPeriodNum) {
+            $condition .= ' AND CFL.PERIOD_NUM>=:START_PERIOD_NUM';
+            $params[':START_PERIOD_NUM'] = $startPeriodNum;
+        }
+        if ($endPeriodNum) {
+            $condition .= ' AND CFL.PERIOD_NUM<=:END_PERIOD_NUM';
+            $params[':END_PERIOD_NUM'] = $endPeriodNum;
+        }
+        $listObj = new TraceFlList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 报单中心货补追溯导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceFlExport() {
+        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
+        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
+        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        if ($startPeriodNum) {
+            $condition .= ' AND CFL.PERIOD_NUM>=:START_PERIOD_NUM';
+            $params[':START_PERIOD_NUM'] = $startPeriodNum;
+        }
+        if ($endPeriodNum) {
+            $condition .= ' AND CFL.PERIOD_NUM<=:END_PERIOD_NUM';
+            $params[':END_PERIOD_NUM'] = $endPeriodNum;
+        }
+        $form = new BonusExportForm();
+        $result = $form->run(['condition'=>$condition, 'params'=>$params], '报单中心货补追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 区域业绩提成追溯
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceFw() {
+        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
+        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
+        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        if ($startPeriodNum) {
+            $condition .= ' AND CFW.PERIOD_NUM>=:START_PERIOD_NUM';
+            $params[':START_PERIOD_NUM'] = $startPeriodNum;
+        }
+        if ($endPeriodNum) {
+            $condition .= ' AND CFW.PERIOD_NUM<=:END_PERIOD_NUM';
+            $params[':END_PERIOD_NUM'] = $endPeriodNum;
+        }
+        $listObj = new TraceFwList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 区域业绩提成导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionTraceFwExport() {
+        $startPeriodNum = Yii::$app->request->get('startPeriodNum');
+        $endPeriodNum = Yii::$app->request->get('endPeriodNum');
+        if (!$startPeriodNum || !$endPeriodNum) return static::notice([]);
+        $filter = $this->filterCondition([
+            'userName' => 'UI.USER_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        if ($startPeriodNum) {
+            $condition .= ' AND CFW.PERIOD_NUM>=:START_PERIOD_NUM';
+            $params[':START_PERIOD_NUM'] = $startPeriodNum;
+        }
+        if ($endPeriodNum) {
+            $condition .= ' AND CFW.PERIOD_NUM<=:END_PERIOD_NUM';
+            $params[':END_PERIOD_NUM'] = $endPeriodNum;
+        }
+        $form = new BonusExportForm();
+        $result = $form->run(['condition'=>$condition, 'params'=>$params], '区域业绩提成追溯');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 业绩单
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionPerfOrder(){
+        $filter = $this->filterCondition([
+            'PERIOD_NUM' => 'PO.PERIOD_NUM',
+            'SN' => 'PO.SN',
+            'DEC_STATUS_NAME' => 'PO.DEC_STATUS',
+            'USER_NAME' => 'U.USER_NAME',
+            'REAL_NAME' => 'U.REAL_NAME',
+            'userIds' => 'PO.USER_ID',
+            'filterType' => 'PO.DEC_TYPE',
+            'LAST_REC_USER_NAME' => 'PO.LAST_REC_USER_NAME',
+            'LAST_REC_REAL_NAME' => 'PO.LAST_REC_REAL_NAME',
+            'PV' => 'PO.PV',
+            'DEC_AMOUNT' => 'PO.DEC_AMOUNT',
+            'DEC_SN' => 'PO.DEC_SN',
+            'CREATED_AT' => 'PO.CREATED_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new PerfOrderList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 业绩单导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionPerfOrderExport() {
+        $filter = $this->filterCondition([
+            'PERIOD_NUM' => 'PO.PERIOD_NUM',
+            'SN' => 'PO.SN',
+            'DEC_STATUS_NAME' => 'PO.DEC_STATUS',
+            'userIds' => 'PO.USER_ID',
+            'filterType' => 'PO.DEC_TYPE',
+            'LAST_REC_USER_NAME' => 'PO.LAST_REC_USER_NAME',
+            'LAST_REC_REAL_NAME' => 'PO.LAST_REC_REAL_NAME',
+            'PV' => 'PO.PV',
+            'DEC_AMOUNT' => 'PO.DEC_AMOUNT',
+            'DEC_SN' => 'PO.DEC_SN',
+            'LAST_SUB_COM_NAME' => 'PO.LAST_SUB_COM_ID',
+            'LAST_SYSTEM_NAME' => 'PO.LAST_SYSTEM_ID',
+            'LAST_AREA' => [
+                'FIELD' => ['PO.LAST_PROVINCE', 'PO.LAST_CITY', 'PO.LAST_COUNTY'],
+                'BIND' => ['LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY'],
+            ],
+            'DEC_USER_NAME' => 'DUI.USER_NAME',
+            'LAST_DEC_DEC_LV_NAME' => 'PO.LAST_DEC_DEC_LV',
+            'LAST_DEC_SUB_COM_NAME' => 'PO.LAST_DEC_SUB_COM_ID',
+            'LAST_DEC_AREA' => [
+                'FIELD' => ['PO.LAST_DEC_PROVINCE', 'PO.LAST_DEC_CITY', 'PO.LAST_DEC_COUNTY'],
+                'BIND' => ['LAST_DEC_PROVINCE', 'LAST_DEC_CITY', 'LAST_DEC_COUNTY'],
+            ],
+            'CREATED_AT' => 'PO.CREATED_AT',
+            'CLOSED_AT' => 'PO.CLOSED_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $form = new BonusExportForm();
+        $result = $form->run(['condition'=>$condition, 'params'=>$params], '业绩单');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 月积分
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionScoreMonth(){
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'userIds' => 'SM.USER_ID',
+            'CALC_MONTH' => 'SM.CALC_MONTH',
+            'CREATED_AT' => 'SM.CREATED_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new ScoreMonthList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 月积分导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionScoreMonthExport() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'userIds' => 'SM.USER_ID',
+            'CALC_MONTH' => 'SM.CALC_MONTH',
+            'CREATED_AT' => 'SM.CREATED_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $form = new BonusExportForm();
+        $result = $form->run(['condition'=>$condition, 'params'=>$params], '月积分');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 月业绩
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionPerfMonth(){
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'REC_USER_NAME' => 'RU.USER_NAME',
+            'userIds' => 'PM.USER_ID',
+            'CALC_MONTH' => 'PM.CALC_MONTH',
+            'CREATED_AT' => 'PM.CREATED_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new PerfMonthList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 月业绩导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionPerfMonthExport() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'REC_USER_NAME' => 'RU.USER_NAME',
+            'userIds' => 'PM.USER_ID',
+            'CALC_MONTH' => 'PM.CALC_MONTH',
+            'CREATED_AT' => 'PM.CREATED_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $form = new BonusExportForm();
+        $result = $form->run(['condition'=>$condition, 'params'=>$params], '月业绩');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+    /**
+     * 期业绩
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionPerfPeriodList(){
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'userIds' => 'PP.USER_ID',
+            'PERIOD_NUM' => 'PP.PERIOD_NUM',
+            'CREATED_AT' => 'PP.CREATED_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new PerfPeriodList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 期业绩导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionPerfPeriodListExport() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'userIds' => 'PP.USER_ID',
+            'PERIOD_NUM' => 'PP.PERIOD_NUM',
+            'CREATED_AT' => 'PP.CREATED_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $form = new BonusExportForm();
+        $result = $form->run(['condition'=>$condition, 'params'=>$params], '期业绩');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+
+    /**
+     * 达标业绩
+     * @return mixed
+     * @throws \yii\base\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionPerfStandard(){
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'REC_USER_NAME' => 'RU.USER_NAME',
+            'userIds' => 'PS.USER_ID',
+            'CALC_MONTH' => 'PS.CALC_MONTH',
+            'CREATED_AT' => 'PS.CREATED_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new PerfStandardList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 达标业绩导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionPerfStandardExport() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+            'REC_USER_NAME' => 'RU.USER_NAME',
+            'userIds' => 'PS.USER_ID',
+            'CALC_MONTH' => 'PS.CALC_MONTH',
+            'CREATED_AT' => 'PS.CREATED_AT',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $form = new BonusExportForm();
+        $result = $form->run(['condition'=>$condition, 'params'=>$params], '达标业绩');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
+
+
+    /**
+     * 会员实时业绩
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionRealTimePerf() {
+        $userName = Yii::$app->request->get('userName');
+        if (!$userId = Info::getUserIdByUserName($userName)) {
+            return static::notice('会员不存在', 400);
+        }
+        $period = Period::instance();
+        $newPerf = Perf::getPeriodNewPerf($userId);
+        $weekData = [['PV_1L' => $newPerf['PV_1L'], 'PV_2L' => $newPerf['PV_2L'], 'PV_3L' => $newPerf['PV_3L'], 'PV_4L' => $newPerf['PV_4L'], 'PV_5L' => $newPerf['PV_5L'], 'PV_PCS'=>Tool::formatPrice($newPerf['PV_PCS']), 'PV_PSS'=>Tool::formatPrice($newPerf['PV_PSS'])]];
+        $monthPerf = Perf::getMonthPerf($userId);
+        $monthData = [['PV_1L' => Tool::formatPrice($monthPerf['PV_1L']), 'PV_2L' => Tool::formatPrice($monthPerf['PV_2L']), 'PV_3L' => Tool::formatPrice($monthPerf['PV_3L']), 'PV_4L' => Tool::formatPrice($monthPerf['PV_4L']), 'PV_5L' => Tool::formatPrice($monthPerf['PV_5L']), 'PV_PCS'=>Tool::formatPrice($monthPerf['PV_PCS']), 'PV_PSS'=>Tool::formatPrice($monthPerf['PV_PSS'])]];
+        $lastMonth = PerfMonth::getMonthPerf($period->getLastMonth()['yearMonth'], $userId);
+        $lastData = [['PV_1L' => Tool::formatPrice($lastMonth['PV_1L_TOTAL']), 'PV_2L' => Tool::formatPrice($lastMonth['PV_2L_TOTAL']), 'PV_3L' => Tool::formatPrice($lastMonth['PV_3L_TOTAL']), 'PV_4L' => Tool::formatPrice($lastMonth['PV_4L_TOTAL']), 'PV_5L' => Tool::formatPrice($lastMonth['PV_5L_TOTAL']), 'PV_PCS'=>Tool::formatPrice($lastMonth['PV_PCS']), 'PV_PSS'=>Tool::formatPrice($lastMonth['PV_PSS']), 'PV_PSS_TOTAL'=>Tool::formatPrice($lastMonth['PV_PSS_TOTAL'])]];
+        //是否合格
+//        $lastChkStatus = '';
+//        $lastMonthPerfChk = Cache::getSystemConfig()['lastMonthPerfChk']['VALUE'];
+//        $lastArr = [$lastMonth['PV_1L_TOTAL'], $lastMonth['PV_2L_TOTAL'], $lastMonth['PV_3L_TOTAL'], $lastMonth['PV_4L_TOTAL'], $lastMonth['PV_5L_TOTAL']];
+//        if (array_sum($lastArr) >= $lastMonthPerfChk) {
+//            $lastChkStatus = '已合格';
+//        }
+        //判断大区
+//        $bigLocation = array_search(max($lastArr), $lastArr) + 1;
+        return static::notice(['weekData' => $weekData, 'monthData' => $monthData, 'lastData' => $lastData]);
+    }
+
+    /**
+     * 荣衔业绩
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionYcPerf() {
+        $userName = Yii::$app->request->get('userName');
+        if (!$userId = Info::getUserIdByUserName($userName)) {
+            return static::notice('会员不存在', 400);
+        }
+
+        $userPerfData = Perf::getUserPerf($userId);
+        $ycPerfList = [];
+        //查找推荐的子会员
+        $childrenList = UserInfo::findUseDbCalc()->select('USER_ID')->where('REC_UID=:REC_UID', [
+            'REC_UID' => $userId
+        ])->asArray()->all();
+        $maxPvPss = 0;
+        $childSumPerf = 0;
+        foreach ($childrenList as $child) {
+            $childBaseUser = Info::getBaseUserById($child['USER_ID']);
+            if( !$childBaseUser ) continue;
+            $childPerfData = Perf::getUserPerf($child['USER_ID']);
+            if( !$childPerfData ) continue;
+
+            $childPvPcs = $childPerfData['PV_PCS_ZC'] + $childPerfData['PV_PCS_FX'];
+
+            $childPvPssTotal = $childPvPcs + $childPerfData['PV_PSS'];
+
+            $childSumPerf += $childPvPssTotal;
+            if( $childPvPssTotal >= $maxPvPss ) {
+                $maxPvPss = $childPvPssTotal;
+            }
+
+            $ycPerfList[] = [
+                'USER_NAME'=>$childBaseUser['USER_NAME'],
+                'REAL_NAME'=>$childBaseUser['REAL_NAME'],
+                'PV_PCS' => $childPerfData['PV_PCS_ZC'] + $childPerfData['PV_PCS_FX'],
+                'PV_PSS_TOTAL' => $childPerfData['PV_PSS_TOTAL'],
+                'MAX_DEPART_PERF' => '-',
+                'OTHER_DEPART_PERF' => '-',
+                'PV_PSS_SUM_TOTAL' => round($childPerfData['PV_PCS_ZC'] + $childPerfData['PV_PCS_FX'] + $childPerfData['PV_PSS_TOTAL'],2),
+            ];
+        }
+
+        if( $userPerfData ) {
+            $baseUser = Info::getBaseUserById($userId);
+            $ycPerfData = [
+                'USER_NAME'=>$baseUser['USER_NAME'],
+                'REAL_NAME'=>$baseUser['REAL_NAME'],
+                'PV_PCS' => $userPerfData['PV_PCS_ZC'] + $userPerfData['PV_PCS_FX'],
+                'PV_PSS_TOTAL' => $userPerfData['PV_PSS_TOTAL'],
+                'MAX_DEPART_PERF' => round($maxPvPss, 2),
+                'OTHER_DEPART_PERF' => round($childSumPerf-$maxPvPss, 2),
+                'PV_PSS_SUM_TOTAL' => round($userPerfData['PV_PCS_ZC'] + $userPerfData['PV_PCS_FX'] + $userPerfData['PV_PSS_TOTAL'],2),
+            ];
+            array_unshift($ycPerfList, $ycPerfData);
+        }
+
+        return static::notice(['ycPerfList' => $ycPerfList]);
+    }
+
+    /**
+     * 用户业绩
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionUserPerf() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $listObj = new UserPerfList();
+        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params]);
+
+        return static::notice($data);
+    }
+
+    /**
+     * 月业绩导出
+     * @return mixed
+     * @throws \yii\db\Exception
+     * @throws \yii\web\HttpException
+     */
+    public function actionUserPerfExport() {
+        $filter = $this->filterCondition([
+            'USER_NAME' => 'U.USER_NAME',
+        ]);
+        $condition = $filter['condition'];
+        $params = $filter['params'];
+        $form = new BonusExportForm();
+        $result = $form->run(['condition'=>$condition, 'params'=>$params], '用户业绩');
+        if (!$result) {
+            return static::notice(Form::formatErrorsForApi($form->getErrors()), 400);
+        }
+        return static::notice('导出开始,请到文件管理-导出文件查看');
+    }
 }

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

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

@@ -1,2043 +1,2043 @@
-import Vue from 'vue'
-import Router from 'vue-router'
-import layout from '../views/layout/layout'
-
-const _import = require('./_import_' + process.env.NODE_ENV)
-
-if(Router.version >= '3.1.0'){
-  const originalPush = Router.prototype.push
-  Router.prototype.push = function push(location) {
-    return originalPush.call(this, location).catch(err => err)
-  }
-}
-
-Vue.use(Router)
-
-export const constantRouterMap = [
-  {path: '/', redirect: '/login'},
-  {path: '/login', component: _import('login/index'), name: 'login'},
-  {path: '/modify-password/:adminName', component: _import('login/modify-password'), name: 'modify-password'},
-  // { path: '/authredirect', component: _import('login/authredirect'), hidden: true },
-  // { path: '/404', component: _import('errorPage/404'), hidden: true },
-  // { path: '/401', component: _import('errorPage/401'), hidden: true },
-  {
-    path: '/dashboard',
-    component: layout,
-    redirect: '/dashboard/index',
-    children: [{
-      path: '/dashboard/index',
-      component: _import('dashboard/index'),
-      name: 'dashboard_index',
-      meta: {
-        title: '控制台',
-        breadcrumb: [
-          {title: '首页', path: '/dashboard/index'},
-        ],
-      },
-    }]
-  },
-  {
-    path: '/shop',
-    component: layout,
-    redirect: '/shop/dec-order-list',
-    children: [
-      {
-        path: '/shop/dec-order-list',
-        component: _import('shop/dec-order-list'),
-        name: 'shop_dec-order-list',
-        meta: {
-          title: '报单列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '商城管理', path: '/shop/dec-order-list'},
-          ],
-        },
-      },
-      {
-        path: '/shop/order-list',
-        component: _import('shop/order-list'),
-        name: 'shop_order-list',
-        meta: {
-          title: '订单列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '商城管理', path: '/shop/dec-order-list'},
-          ],
-        },
-
-      },
-      {
-        path: '/shop/order-shop-list',
-        component: _import('shop/order-shop-list'),
-        name: 'shop_order_shop-list',
-        meta: {
-          title: '外部商城订单列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '商城管理', path: '/shop/dec-order-list'},
-          ],
-        },
-
-      },
-        {
-            path: '/shop/order-dec-list',
-            component: _import('shop/order-dec-list'),
-            name: 'shop_order_dec-list',
-            meta: {
-                title: '外部商城报单列表',
-                breadcrumb: [
-                    {title: '首页', path: '/dashboard/index'},
-                    {title: '商城管理', path: '/shop/dec-order-list'},
-                ],
-            },
-
-        },
-      {
-        path: '/shop/order-standard-list',
-        component: _import('shop/order-standard-list'),
-        name: 'shop_order_standard-list',
-        meta: {
-          title: '外部商城达标订单列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '商城管理', path: '/shop/dec-order-list'},
-          ],
-        },
-
-      },
-        {
-            path: '/shop/package',
-            component: _import('shop/package'),
-            name: 'shop_package',
-            meta: {
-                title: '报单套餐列表',
-                breadcrumb: [
-                    {title: '首页', path: '/dashboard/index'},
-                    {title: '商城管理', path: '/shop/dec-order-list'},
-                ],
-            },
-
-        },
-        {
-            path: '/shop/package-add',
-            component: _import('shop/package-add'),
-            name: 'shop_package-add',
-            meta: {
-                title: '报单套餐添加',
-                breadcrumb: [
-                    {title: '首页', path: '/dashboard/index'},
-                    {title: '商城管理', path: '/shop/dec-order-list'},
-                ],
-            },
-
-        },
-        {
-            path: '/shop/index',
-            component: _import('shop/index'),
-            name: 'shop_index',
-            meta: {
-                title: '商品列表',
-                breadcrumb: [
-                    {title: '首页', path: '/dashboard/index'},
-                    {title: '商城管理', path: '/shop/dec-order-list'},
-                ],
-            },
-
-        },
-        {
-            path: '/shop/goods-add',
-            component: _import('shop/goods-add'),
-            name: 'shop_goods-add',
-            meta: {
-                title: '商品添加',
-                breadcrumb: [
-                    {title: '首页', path: '/dashboard/index'},
-                    {title: '商城管理', path: '/shop/dec-order-list'},
-                ],
-            },
-
-        },
-    ],
-  },
-  {
-    path: '/user',
-    component: layout,
-    redirect: '/user/index',
-    children: [
-      {
-        path: '/user/index',
-        component: _import('user/index'),
-        name: 'user_index',
-        meta: {
-          title: '会员列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/user-add-opt',
-        component: _import('user/user-add-opt'),
-        name: 'user_user-add-opt',
-        meta: {
-          title: '空单操作',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-        {
-            path: '/user/empty-list',
-            component: _import('user/empty-list'),
-            name: 'user_empty_list',
-            meta: {
-                title: '空单列表',
-                breadcrumb: [
-                    {title: '首页', path: '/dashboard/index'},
-                    {title: '会员管理', path: '/user/index'},
-                ],
-            },
-        },
-      {
-        path: '/user/bind',
-        component: _import('user/bind'),
-        name: 'user_bind',
-        meta: {
-          title: '点位绑定',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/bind-add',
-        component: _import('user/bind-edit'),
-        name: 'user_bind-add',
-        meta: {
-          title: '添加点位绑定',
-          highLight: '/user/bind',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-            {title: '点位绑定', path: '/user/bind'},
-          ],
-        },
-      },
-      {
-        path: '/user/bind-edit/:id',
-        component: _import('user/bind-edit'),
-        name: 'user_bind-edit',
-        meta: {
-          title: '编辑点位绑定',
-          highLight: '/user/bind',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-            {title: '点位绑定', path: '/user/bind'},
-          ],
-        },
-      },
-      {
-        path: '/user/teamwork',
-        component: _import('user/teamwork'),
-        name: 'user_teamwork',
-        meta: {
-          title: '点位合作',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/teamwork-add',
-        component: _import('user/teamwork-edit'),
-        name: 'user_teamwork-add',
-        meta: {
-          title: '添加点位合作',
-          highLight: '/user/teamwork',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-            {title: '点位合作', path: '/user/teamwork'},
-          ],
-        },
-      },
-      {
-        path: '/user/teamwork-edit/:id',
-        component: _import('user/teamwork-edit'),
-        name: 'user_teamwork-edit',
-        meta: {
-          title: '编辑点位合作',
-          highLight: '/user/teamwork',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-            {title: '点位合作', path: '/user/teamwork'},
-          ],
-        },
-      },
-      {
-        path: '/user/system',
-        component: _import('user/system'),
-        name: 'user_system',
-        meta: {
-          title: '体系管理',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/system-add',
-        component: _import('user/system-edit'),
-        name: 'user_system-add',
-        meta: {
-          title: '添加体系',
-          highLight: '/user/system',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-            {title: '体系管理', path: '/user/system'},
-          ],
-        },
-      },
-      {
-        path: '/user/system-edit/:id',
-        component: _import('user/system-edit'),
-        name: 'user_system-edit',
-        meta: {
-          title: '编辑体系',
-          highLight: '/user/system',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-            {title: '体系管理', path: '/user/system'},
-          ],
-        },
-      },
-      {
-        path: '/user/group',
-        component: _import('user/group'),
-        name: 'user_group',
-        meta: {
-          title: '团队领导人列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/move',
-        component: _import('user/move'),
-        name: 'user_move',
-        meta: {
-          title: '移网管理',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/move-add',
-        component: _import('user/move-add'),
-        name: 'user_move-add',
-        meta: {
-          title: '申请移网',
-          highLight: '/user/move',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-            {title: '移网管理', path: '/user/move'},
-          ],
-        },
-      },
-      {
-        path: '/user/reg-info',
-        component: _import('user/reg-info'),
-        name: 'user_reg-info',
-        meta: {
-          title: '注册信息报表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/reg-info-audit',
-        component: _import('user/reg-info-audit'),
-        name: 'user_reg-info-audit',
-        meta: {
-          title: '注册信息审核',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/reg-info-audit-add-opt/:id?',
-        component: _import('user/reg-info-audit-add-opt'),
-        name: 'user_reg-info-audit-add-opt',
-        meta: {
-          title: '注册信息添加操作',
-          highLight: '/user/reg-info-audit',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-            {title: '注册信息审核', path: '/user/reg-info-audit'},
-          ],
-        },
-      },
-      {
-        path: '/user/status-audit-list',
-        component: _import('user/status-audit-list'),
-        name: 'user_status-audit-list',
-        meta: {
-          title: '会员状态管理',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/status-audit-add',
-        component: _import('user/status-audit-add'),
-        name: 'user_status-audit-add',
-        meta: {
-          title: '申请修改会员状态',
-          highLight: '/user/status-audit-list',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-            {title: '会员状态管理', path: '/user/status-audit-list'},
-          ],
-        },
-      },
-      {
-        path: '/user/status-audit-add/:userName',
-        component: _import('user/status-audit-add'),
-        name: 'user_status-audit-add-username',
-        meta: {
-          title: '申请修改会员状态',
-          highLight: '/user/status-audit-list',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-            {title: '会员状态管理', path: '/user/status-audit-list'},
-          ],
-        },
-      },
-        {
-            path: '/user/dec-level-list',
-            component: _import('user/dec-level-list'),
-            name: 'user_dec-level-list',
-            meta: {
-                title: '会员级别调整列表',
-                breadcrumb: [
-                    {title: '首页', path: '/dashboard/index'},
-                    {title: '会员管理', path: '/user/index'},
-                ],
-            },
-        },
-      {
-        path: '/user/change-user-dec-level',
-        component: _import('user/change-user-dec-level'),
-        name: 'user_change-user-dec-level',
-        meta: {
-          title: '修改会员级别',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/change-user-dec-role',
-        component: _import('user/change-user-dec-role'),
-        name: 'user_change-user-dec-role',
-        meta: {
-          title: '修改报单中心级别',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/year-highest-emp-lv',
-        component: _import('user/year-highest-emp-lv'),
-        name: 'user_year-highest-emp-lv',
-        meta: {
-          title: '会员历史年度最高聘级表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-      {
-        path: '/user/change-show-emp-level',
-        component: _import('user/change-show-emp-level'),
-        name: 'user_change-show-emp-level',
-        meta: {
-          title: '修改会员前台显示聘级',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '会员管理', path: '/user/index'},
-          ],
-        },
-      },
-    ]
-  },
-  {
-    path: '/atlas',
-    component: layout,
-    redirect: '/atlas/relation-opt',
-    children: [
-      {
-        path: '/atlas/relation-opt',
-        component: _import('atlas/relation-opt'),
-        name: 'atlas_relation-opt',
-        meta: {
-          title: '开拓网络',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '网络图谱', path: '/atlas/relation-opt'},
-          ],
-        },
-      },
-      {
-        path: '/atlas/network-opt',
-        component: _import('atlas/network-opt'),
-        name: 'atlas_network-opt',
-        meta: {
-          title: '安置网络',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '网络图谱', path: '/atlas/relation-opt'},
-          ],
-        },
-      },
-      {
-        path: '/atlas/network-line-opt',
-        component: _import('atlas/network-line-opt'),
-        name: 'atlas_network-line-opt',
-        meta: {
-          title: '安置链路',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '网络图谱', path: '/atlas/relation-opt'},
-          ],
-        },
-      },
-      {
-        path: '/atlas/emp-user-line',
-        component: _import('atlas/emp-user-line'),
-        name: 'atlas_emp-user-line',
-        meta: {
-          title: '聘级网络',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '网络图谱', path: '/atlas/relation-opt'},
-          ],
-        },
-      },
-      // {
-      //   path: '/atlas/emp-user-list',
-      //   component: _import('atlas/emp-user-list'),
-      //   name: 'atlas_emp-user-list',
-      //   meta: {
-      //     title: '聘级网络列表',
-      //     breadcrumb: [
-      //       {title: '首页', path: '/dashboard/index'},
-      //       {title: '网络图谱', path: '/atlas/relation-opt'},
-      //     ],
-      //   },
-      // },
-
-
-    ]
-  },
-  {
-    path: '/reconsume',
-    component: layout,
-    redirect: '/reconsume/pool-list',
-    children: [
-      {
-        path: '/reconsume/pool-list',
-        component: _import('reconsume/pool-list'),
-        name: 'reconsume_pool-list',
-        meta: {
-          title: '复销池余额列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '复销管理', path: '/reconsume/pool-list'},
-          ],
-        },
-      },
-      {
-        path: '/reconsume/deduct',
-        component: _import('reconsume/deduct'),
-        name: 'reconsume_deduct',
-        meta: {
-          title: '手动扣除月复销',
-          highLight: '/reconsume/deduct',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '复销管理', path: '/reconsume/pool-list'},
-          ],
-        },
-      },
-      {
-        path: '/reconsume/change-audit-list',
-        component: _import('reconsume/change-audit-list'),
-        name: 'reconsume_change-audit-list',
-        meta: {
-          title: '复销余额调整审核',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '复销管理', path: '/reconsume/pool-list'},
-          ],
-        },
-      },
-      {
-        path: '/reconsume/change-audit-add/:userName?',
-        component: _import('reconsume/change-audit-add'),
-        name: 'reconsume_change-audit-add',
-        meta: {
-          title: '申请调整复销池余额',
-          highLight: '/reconsume/change-audit-list',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '复销管理', path: '/reconsume/pool-list'},
-            {title: '复销余额调整审核', path: '/reconsume/change-audit-list'},
-          ],
-        },
-      },
-      {
-        path: '/reconsume/deduct-audit-list',
-        component: _import('reconsume/deduct-audit-list'),
-        name: 'reconsume_deduct-audit-list',
-        meta: {
-          title: '扣除复销审核',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '复销管理', path: '/reconsume/pool-list'},
-          ],
-        },
-      },
-      {
-        path: '/reconsume/deduct-audit-add',
-        component: _import('reconsume/deduct-audit-add'),
-        name: 'reconsume_deduct-audit-add',
-        meta: {
-          title: '手动扣除月复销',
-          highLight: '/reconsume/deduct-audit-list',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '复销管理', path: '/reconsume/pool-list'},
-          ],
-        },
-      },
-      {
-        path: '/reconsume/flow-list',
-        component: _import('reconsume/flow-list'),
-        name: 'reconsume_flow-list',
-        meta: {
-          title: '复销流水',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '复销管理', path: '/reconsume/pool-list'},
-          ],
-        },
-      },
-    ]
-  },
-  {
-    path: '/bonus',
-    component: layout,
-    redirect: '/bonus/period',
-    children: [
-      {
-        path: '/bonus/period',
-        component: _import('bonus/period'),
-        name: 'bonus_period',
-        meta: {
-          title: '封期管理',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/balance-list',
-        component: _import('bonus/balance-list'),
-        name: 'bonus_balance-list',
-        meta: {
-          title: '会员奖金余额',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-
-      {
-        path: '/bonus/period-detail/:periodNum',
-        component: _import('bonus/period-detail'),
-        name: 'bonus_period-detail',
-        meta: {
-          title: '期奖金明细',
-          highLight: '/bonus/period',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-            {title: '封期管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/new-period-bonus',
-        component: _import('bonus/new-period-bonus'),
-        name: 'bonus_new-period-bonus',
-        meta: {
-          title: '最新奖金',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/other-period-bonus',
-        component: _import('bonus/other-period-bonus'),
-        name: 'bonus_other-period-bonus',
-        meta: {
-          title: '往期奖金',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/flow-bonus',
-        component: _import('bonus/flow-bonus'),
-        name: 'bonus_flow-bonus',
-        meta: {
-          title: '奖金流水',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/flow-rp',
-        component: _import('bonus/flow-rp'),
-        name: 'bonus_flow-rp',
-        meta: {
-          title: '复消积分流水',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/flow-balance',
-        component: _import('bonus/flow-balance'),
-        name: 'bonus_flow-balance',
-        meta: {
-          title: '用户余额流水',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/flow-exchange',
-        component: _import('bonus/flow-exchange'),
-        name: 'bonus_flow-exchange',
-        meta: {
-          title: '兑换积分流水',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/flow-lx',
-        component: _import('bonus/flow-lx'),
-        name: 'bonus_flow-lx',
-        meta: {
-          title: '领袖分红奖流水',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/cf-lx-audit-list',
-        component: _import('bonus/cf-lx-audit-list'),
-        name: 'bonus_cf-lx-audit-list',
-        meta: {
-          title: '年度奖金发放审核',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/cf-lx-apply',
-        component: _import('bonus/cf-lx-apply'),
-        name: 'bonus_cf-lx-apply',
-        meta: {
-          title: '申请发放年度奖',
-          highLight: '/bonus/cf-lx-audit-list',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-            {title: '年度奖金发放审核', path: '/bonus/cf-lx-audit-list'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/perf',
-        component: _import('bonus/perf'),
-        name: 'bonus_perf',
-        meta: {
-          title: '业绩管理',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/calc-qy',
-        component: _import('bonus/calc-qy'),
-        name: 'bonus_calc-qy',
-        meta: {
-          title: '区域津贴核算',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/resend-qy-list',
-        component: _import('bonus/resend-qy-list'),
-        name: 'bonus_resend-qy-list',
-        meta: {
-          title: '区域津贴补发列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/resend-qy-audit-list',
-        component: _import('bonus/resend-qy-audit-list'),
-        name: 'bonus_resend-qy-audit-list',
-        meta: {
-          title: '补发区域津贴审核列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/trace-down-qy',
-        component: _import('bonus/trace-down-qy'),
-        name: 'bonus_trace-down-qy',
-        meta: {
-          title: '团队奖向下追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/trace-up-qy',
-        component: _import('bonus/trace-up-qy'),
-        name: 'bonus_trace-up-qy',
-        meta: {
-          title: '团队奖向上追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/trace-down-yc',
-        component: _import('bonus/trace-down-yc'),
-        name: 'bonus_trace-down-yc',
-        meta: {
-          title: '荣衔奖向下追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/trace-up-yc',
-        component: _import('bonus/trace-up-yc'),
-        name: 'bonus_trace-up-yc',
-        meta: {
-          title: '荣衔奖向上追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-          path: '/bonus/trace-down-bd',
-          component: _import('bonus/trace-down-bd'),
-          name: 'bonus_trace-down-bd',
-          meta: {
-              title: '报单奖向下追溯',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-          path: '/bonus/trace-up-bd',
-          component: _import('bonus/trace-up-bd'),
-          name: 'bonus_trace-up-bd',
-          meta: {
-              title: '报单奖向上追溯',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-          path: '/bonus/trace-down-tg',
-          component: _import('bonus/trace-down-tg'),
-          name: 'bonus_trace-down-tg',
-          meta: {
-              title: '推广奖向下追溯',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-          path: '/bonus/trace-up-tg',
-          component: _import('bonus/trace-up-tg'),
-          name: 'bonus_trace-up-tg',
-          meta: {
-              title: '推广奖向上追溯',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-        path: '/bonus/trace-down-xf',
-        component: _import('bonus/trace-down-xf'),
-        name: 'bonus_trace-down-xf',
-        meta: {
-          title: '消费奖向下追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/trace-up-xf',
-        component: _import('bonus/trace-up-xf'),
-        name: 'bonus_trace-up-xf',
-        meta: {
-          title: '消费奖向上追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-          path: '/bonus/trace-down-yj',
-          component: _import('bonus/trace-down-yj'),
-          name: 'bonus_trace-down-yj',
-          meta: {
-              title: '业绩奖向下追溯',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-          path: '/bonus/trace-up-yj',
-          component: _import('bonus/trace-up-yj'),
-          name: 'bonus_trace-up-yj',
-          meta: {
-              title: '业绩奖向上追溯',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-          path: '/bonus/trace-down-gx',
-          component: _import('bonus/trace-down-gx'),
-          name: 'bonus_trace-down-gx',
-          meta: {
-              title: '共享奖向下追溯',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-          path: '/bonus/trace-up-gx',
-          component: _import('bonus/trace-up-gx'),
-          name: 'bonus_trace-up-gx',
-          meta: {
-              title: '共享奖向上追溯',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-          path: '/bonus/trace-down-gl',
-          component: _import('bonus/trace-down-gl'),
-          name: 'bonus_trace-down-gl',
-          meta: {
-              title: '管理奖向下追溯',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-          path: '/bonus/trace-up-gl',
-          component: _import('bonus/trace-up-gl'),
-          name: 'bonus_trace-up-gl',
-          meta: {
-              title: '管理奖向上追溯',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-        path: '/bonus/trace-down-fx',
-        component: _import('bonus/trace-down-fx'),
-        name: 'bonus_trace-down-fx',
-        meta: {
-          title: '复销奖向下追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/trace-up-fx',
-        component: _import('bonus/trace-up-fx'),
-        name: 'bonus_trace-up-fx',
-        meta: {
-          title: '复销奖向上追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/trace-bt',
-        component: _import('bonus/trace-bt'),
-        name: 'bonus_trace-bt',
-        meta: {
-          title: '报单中心补贴追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/trace-fl',
-        component: _import('bonus/trace-fl'),
-        name: 'bonus_trace-fl',
-        meta: {
-          title: '报单中心货补追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/trace-fw',
-        component: _import('bonus/trace-fw'),
-        name: 'bonus_trace-fw',
-        meta: {
-          title: '区域业绩提成追溯',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/perf-order',
-        component: _import('bonus/perf-order'),
-        name: 'bonus_perf-order',
-        meta: {
-          title: '业绩单',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/perf-period-list',
-        component: _import('bonus/perf-period-list'),
-        name: 'bonus_perf-period-list',
-        meta: {
-          title: '期业绩',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-          path: '/bonus/perf-month',
-          component: _import('bonus/perf-month'),
-          name: 'bonus_perf-month',
-          meta: {
-              title: '月业绩',
-              breadcrumb: [
-                  {title: '首页', path: '/dashboard/index'},
-                  {title: '奖金管理', path: '/bonus/period'},
-              ],
-          },
-      },
-      {
-        path: '/bonus/perf-standard',
-        component: _import('bonus/perf-standard'),
-        name: 'bonus_perf-standard',
-        meta: {
-          title: '达标业绩',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/score-month',
-        component: _import('bonus/score-month'),
-        name: 'bonus_score-month',
-        meta: {
-          title: '月积分',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/real-time-perf',
-        component: _import('bonus/real-time-perf'),
-        name: 'bonus_real-time-perf',
-        meta: {
-          title: '会员实时业绩',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/yc-perf',
-        component: _import('bonus/yc-perf'),
-        name: 'bonus_yc-perf',
-        meta: {
-          title: '荣衔业绩',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-      {
-        path: '/bonus/user-perf',
-        component: _import('bonus/user-perf'),
-        name: 'leo-user-perf-table',
-        meta: {
-          title: '用户业绩',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '奖金管理', path: '/bonus/period'},
-          ],
-        },
-      },
-    ]
-  },
-  {
-    path: '/report',
-    component: layout,
-    redirect: '/report/dec',
-    children: [
-      {
-        path: '/report/dec',
-        component: _import('report/dec'),
-        name: 'report_dec',
-        meta: {
-          title: '报单查询',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '报表管理', path: '/report/dec'},
-          ],
-        },
-      },
-    ]
-  },
-  {
-    path: '/finance',
-    component: layout,
-    redirect: '/finance/balance-audit-list',
-    children: [
-      {
-        path: '/finance/balance-audit-list',
-        component: _import('finance/balance-audit-list'),
-        name: 'finance_balance-audit-list',
-        meta: {
-          title: '会员余额调整列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '财务管理', path: '/finance/balance-audit-list'},
-          ],
-        },
-      },
-      {
-        path: '/finance/change-balance-opt',
-        component: _import('finance/change-balance-opt'),
-        name: 'finance_change-balance-opt',
-        meta: {
-          title: '申请调整会员余额',
-          highLight: '/finance/balance-audit-list',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '财务管理', path: '/finance/balance-audit-list'},
-            {title: '会员余额调整列表', path: '/finance/balance-audit-list'},
-          ],
-        },
-      },
-      {
-        path: '/finance/dec-list',
-        component: _import('finance/dec-list'),
-        name: 'finance_dec-list',
-        meta: {
-          title: '报单订货单列表',
-          highLight: '/finance/dec-list',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '财务管理', path: '/finance/balance-audit-list'},
-          ],
-        },
-      },
-      {
-        path: '/finance/transfer-list',
-        component: _import('finance/transfer-list'),
-        name: 'finance_transfer-list',
-        meta: {
-          title: '转账记录列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '财务管理', path: '/finance/balance-audit-list'},
-          ],
-        },
-      },
-      {
-        path: '/finance/withdraw',
-        component: _import('finance/withdraw'),
-        name: 'finance_withdraw',
-        meta: {
-          title: '提现管理',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '提现管理', path: '/finance/withdraw'},
-          ],
-        },
-      },
-      {
-        path: '/finance/withdraw-add',
-        component: _import('finance/withdraw-add'),
-        name: 'finance_withdraw-add',
-        meta: {
-          title: '新增提现',
-          highLight: '/finance/withdraw',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '提现管理', path: '/finance/withdraw'},
-            {title: '新增提现', path: '/finance/withdraw-add'},
-          ],
-        },
-      },
-      {
-        path: '/finance/invoice-audit',
-        component: _import('finance/invoice-audit'),
-        name: 'finance_invoice-audit',
-        meta: {
-          title: '发票管理',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '发票管理', path: '/finance/invoice-audit'},
-          ],
-        },
-      },
-      {
-        path: '/finance/perf-audit-list',
-        component: _import('finance/perf-audit-list'),
-        name: 'finance_perf-audit-list',
-        meta: {
-          title: '会员业绩调整列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '财务管理', path: '/finance/balance-audit-list'},
-          ],
-        },
-      },
-      {
-        path: '/finance/perf-apply',
-        component: _import('finance/perf-apply'),
-        name: 'finance_perf-apply',
-        meta: {
-          title: '调整会员业绩',
-          highLight: '/finance/perf-audit-list',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '财务管理', path: '/finance/balance-audit-list'},
-            {title: '调整会员业绩', path: '/finance/perf-audit-list'},
-          ],
-        },
-      },
-      {
-        path: '/finance/deal-type',
-        component: _import('finance/deal-type'),
-        name: 'finance_deal-type',
-        meta: {
-          title: '交易类型',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '交易类型', path: '/finance/deal-type'},
-          ],
-        },
-      },
-      {
-        path: '/finance/deal-type-add',
-        component: _import('finance/deal-type-add'),
-        name: 'finance_deal-type-add',
-        meta: {
-          title: '交易类型添加',
-          highLight: '/finance/deal-type',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '交易类型', path: '/finance/deal-type'},
-            {title: '交易类型添加', path: '/finance/deal-type-add'},
-          ],
-        },
-      },
-      {
-        path: '/finance/history-bonus',
-        component: _import('finance/history-bonus'),
-        name: 'finance_history-bonus',
-        meta: {
-          title: '历史奖金余额',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '财务管理', path: '/finance/balance-audit-list'},
-          ],
-        },
-      },
-        {
-            path: '/finance/recharge',
-            component: _import('finance/recharge'),
-            name: 'finance_recharge',
-            meta: {
-                title: '充值管理',
-                breadcrumb: [
-                    {title: '首页', path: '/dashboard/index'},
-                    {title: '财务管理', path: '/finance/balance-audit-list'},
-                ],
-            },
-        },
-        {
-            path: '/finance/recharge-status',
-            component: _import('finance/recharge-status'),
-            name: 'finance_recharge-status',
-            meta: {
-                title: '状态管理',
-                breadcrumb: [
-                    {title: '首页', path: '/dashboard/index'},
-                    {title: '财务管理', path: '/finance/balance-audit-list'},
-                ],
-            },
-        },
-    ]
-  },
-  {
-    path: '/article',
-    component: layout,
-    redirect: '/article/category',
-    children: [
-      {
-        path: '/article/category',
-        component: _import('article/category'),
-        name: 'article_category',
-        meta: {
-          title: '分类管理',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '分类管理', path: '/article/category'},
-          ],
-        },
-      },
-      {
-        path: '/article/category-add',
-        component: _import('article/category-add'),
-        name: 'article_category-add',
-        meta: {
-          title: '添加分类',
-          highLight: '/article/category-add',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '分类管理', path: '/article/category'},
-            {title: '添加分类', path: '/article/category-add'},
-          ],
-        },
-      },
-      {
-        path: '/article/index',
-        component: _import('article/index'),
-        name: 'article_index',
-        meta: {
-          title: '文章列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '文章列表', path: '/article/index'},
-          ],
-        },
-      },
-      {
-        path: '/article/add',
-        component: _import('article/edit'),
-        name: 'article_add',
-        meta: {
-          title: '添加文章',
-          highLight: '/article/index',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '文章列表', path: '/article/index'},
-            {title: '添加文章', path: '/article/add'},
-          ],
-        },
-      },
-      {
-        path: '/article/edit/:id',
-        component: _import('article/edit'),
-        name: 'article_edit',
-        meta: {
-          title: '编辑文章',
-          highLight: '/article/index',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '文章列表', path: '/article/index'},
-            {title: '编辑文章', path: '/article/edit'},
-          ],
-        },
-      },
-    ]
-  },
-  {
-    path: '/message',
-    component: layout,
-    redirect: '/message/list',
-    children: [
-      {
-        path: '/message/list',
-        component: _import('message/list'),
-        name: 'message_list',
-        meta: {
-          title: '站内信列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '站内信管理', path: '/message/list'},
-          ],
-        },
-      },
-      {
-        path: '/message/add',
-        component: _import('message/edit'),
-        name: 'message_add',
-        meta: {
-          title: '添加站内信',
-          highLight: '/message/list',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '站内信管理', path: '/message/list'},
-            {title: '站内信列表', path: '/message/list'},
-          ],
-        },
-      },
-    ]
-  },
-  {
-    path: '/file',
-    component: layout,
-    redirect: '/file/export',
-    children: [
-      {
-        path: '/file/export',
-        component: _import('file/export'),
-        name: 'file_export',
-        meta: {
-          title: '导出文件',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '文件管理', path: '/bonus/period'},
-          ],
-        },
-      },
-    ]
-  },
-  {
-    path: '/admin',
-    component: layout,
-    redirect: '/admin/index',
-    children: [
-      {
-        path: '/admin/change-password',
-        component: _import('admin/edit'),
-        name: 'admin_change-password',
-        meta: {
-          title: '重置密码',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '管理员管理', path: '/admin/index'},
-          ],
-        },
-      },
-      {
-        path: '/admin/index',
-        component: _import('admin/index'),
-        name: 'admin_index',
-        meta: {
-          title: '管理员列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '管理员管理', path: '/admin/index'},
-          ],
-        },
-      }, {
-        path: '/admin/add',
-        component: _import('admin/edit'),
-        name: 'admin_add',
-        meta: {
-          title: '添加管理员',
-          highLight: '/admin/index',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '管理员管理', path: '/admin/index'},
-            {title: '管理员列表', path: '/admin/index'},
-          ],
-        },
-      }, {
-        path: '/admin/edit/:id',
-        component: _import('admin/edit'),
-        name: 'admin_edit',
-        meta: {
-          title: '编辑管理员',
-          highLight: '/admin/index',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '管理员管理', path: '/admin/index'},
-            {title: '管理员列表', path: '/admin/index'},
-          ],
-        },
-      }, {
-        path: '/admin/role',
-        component: _import('admin/role'),
-        name: 'admin_role',
-        meta: {
-          title: '管理员角色列表',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '管理员管理', path: '/admin/index'},
-          ],
-        },
-      }, {
-        path: '/admin/role-add',
-        component: _import('admin/role-add'),
-        name: 'admin_role-add',
-        meta: {
-          title: '添加管理员角色',
-          highLight: '/admin/role',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '管理员管理', path: '/admin/index'},
-            {title: '管理员角色列表', path: '/admin/role'},
-          ],
-        },
-      },{
-        path: '/admin/role-edit/:id',
-        component: _import('admin/role-add'),
-        name: 'admin_role-edit',
-        meta: {
-          title: '编辑管理员角色',
-          highLight: '/admin/role',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '管理员管理', path: '/admin/index'},
-            {title: '管理员角色列表', path: '/admin/role'},
-          ],
-        },
-      }, {
-        path: '/admin/role-permission/:id',
-        component: _import('admin/role-permission'),
-        name: 'admin_role-permission',
-        meta: {
-          title: '管理员角色权限',
-          highLight: '/admin/role',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '管理员管理', path: '/admin/index'},
-            {title: '管理员角色列表', path: '/admin/role'},
-          ],
-        },
-      }, {
-        path: '/admin/role-column/:id',
-        component: _import('admin/role-column'),
-        name: 'admin_role-column',
-        meta: {
-          title: '管理员角色列表字段权限',
-          highLight: '/admin/role',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '管理员管理', path: '/admin/index'},
-            {title: '管理员角色列表', path: '/admin/role'},
-          ],
-        },
-      }, {
-        path: '/admin/test',
-        component: _import('admin/test'),
-        name: 'admin_test',
-      }]
-  },
-  {
-    path: '/ad',
-    component: layout,
-    redirect: '/ad/location',
-    children: [
-      {
-        path: '/ad/location',
-        component: _import('ad/location'),
-        name: 'ad_location',
-        meta: {
-          title: '广告位',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '广告管理', path: '/ad/location'},
-          ],
-        },
-      },
-      {
-        path: '/ad/list/:lid',
-        component: _import('ad/list'),
-        name: 'ad_list',
-        meta: {
-          title: '广告列表',
-          highLight: '/ad/location',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '广告管理', path: '/ad/location'},
-            {title: '广告位', path: '/ad/location'},
-          ],
-        },
-      },
-      {
-        path: '/ad/add',
-        component: _import('ad/edit'),
-        name: 'ad_add',
-        meta: {
-          title: '添加广告',
-          highLight: '/ad/location',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '广告管理', path: '/ad/location'},
-            {title: '广告位', path: '/ad/location'},
-          ],
-        },
-      },
-      {
-        path: '/ad/edit/:id',
-        component: _import('ad/edit'),
-        name: 'ad_edit',
-        meta: {
-          title: '编辑广告',
-          highLight: '/ad/location',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '广告管理', path: '/ad/location'},
-            {title: '广告位', path: '/ad/location'},
-          ],
-        },
-      },
-    ]
-  },
-  {
-    path: '/log',
-    component: layout,
-    redirect: '/log/admin-login',
-    children: [
-      {
-        path: '/log/admin-login',
-        component: _import('log/admin-login'),
-        name: 'log_admin-login',
-        meta: {
-          title: '管理员登录日志',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '日志管理', path: '/log/admin-login'},
-          ],
-        },
-      },
-      {
-        path: '/log/user-login',
-        component: _import('log/user-login'),
-        name: 'log_user-login',
-        meta: {
-          title: '会员登录日志',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '日志管理', path: '/log/user-login'},
-          ],
-        },
-      },
-      {
-        path: '/log/admin-handle',
-        component: _import('log/admin-handle'),
-        name: 'log_admin-handle',
-        meta: {
-          title: '管理员操作日志',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '日志管理', path: '/log/admin-login'},
-          ],
-        },
-      },
-      {
-        path: '/log/user-handle',
-        component: _import('log/user-handle'),
-        name: 'log_user-handle',
-        meta: {
-          title: '会员操作日志',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '日志管理', path: '/log/admin-login'},
-          ],
-        },
-      },
-      {
-        path: '/log/system',
-        component: _import('log/system'),
-        name: 'log_system',
-        meta: {
-          title: '系统日志',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '日志管理', path: '/log/admin-login'},
-          ],
-        },
-      },
-    ]
-  },
-  {
-    path: '/config',
-    component: layout,
-    redirect: '/config/base',
-    children: [
-      {
-        path: '/config/base',
-        component: _import('config/base'),
-        name: 'config_base',
-        meta: {
-          title: '站点设置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/base'},
-          ],
-        },
-      }, {
-        path: '/config/period',
-        component: _import('config/period'),
-        name: 'config_period',
-        meta: {
-          title: '期数配置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      }, {
-        path: '/config/other',
-        component: _import('config/other'),
-        name: 'config_other',
-        meta: {
-          title: '其他配置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      }, {
-        path: '/config/dec-level',
-        component: _import('config/dec-level'),
-        name: 'config_dec-level',
-        meta: {
-          title: '会员级别配置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      }, {
-        path: '/config/dec-level-add',
-        component: _import('config/dec-level-edit'),
-        name: 'config_dec-level-add',
-        meta: {
-          title: '添加会员级别',
-          highLight: '/config/dec-level',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-            {title: '会员级别配置', path: '/config/dec-level'},
-          ],
-        },
-      }, {
-        path: '/config/dec-level-edit/:id',
-        component: _import('config/dec-level-edit'),
-        name: 'config_dec-level-edit',
-        meta: {
-          title: '编辑会员级别',
-          highLight: '/config/dec-level',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-            {title: '会员级别配置', path: '/config/dec-level'},
-          ],
-        },
-      }, {
-        path: '/config/dec-role',
-        component: _import('config/dec-role'),
-        name: 'config_dec-role',
-        meta: {
-          title: '报单中心级别配置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      }, {
-        path: '/config/dec-role-edit/:id',
-        component: _import('config/dec-role-edit'),
-        name: 'config_dec-role-edit',
-        meta: {
-          title: '编辑报单中心级别',
-          highLight: '/config/dec-role',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-            {title: '报单中心级别配置', path: '/config/dec-role'},
-          ],
-        },
-      }, {
-        path: '/config/emp-level',
-        component: _import('config/emp-level'),
-        name: 'config_emp-level',
-        meta: {
-          title: '会员聘级配置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      }, {
-        path: '/config/emp-level-add',
-        component: _import('config/emp-level-edit'),
-        name: 'config_emp-level-add',
-        meta: {
-          title: '添加聘级',
-          highLight: '/config/emp-level',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-            {title: '聘级管理', path: '/config/emp-level'},
-          ],
-        },
-      }, {
-        path: '/config/emp-level-edit/:id',
-        component: _import('config/emp-level-edit'),
-        name: 'config_emp-level-edit',
-        meta: {
-          title: '编辑聘级',
-          highLight: '/config/emp-level',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-            {title: '聘级管理', path: '/config/emp-level'},
-          ],
-        },
-      }, {
-        path: '/config/reg-type',
-        component: _import('config/reg-type'),
-        name: 'config_reg-type',
-        meta: {
-          title: '会员注册类型配置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      }, {
-        path: '/config/bonus-opt',
-        component: _import('config/bonus-opt'),
-        name: 'config_bonus-opt',
-        meta: {
-          title: '奖金设置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      }, {
-        path: '/config/clear-data',
-        component: _import('config/clear-data'),
-        name: 'config_clear-data',
-        meta: {
-          title: '清空数据',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      }, {
-        path: '/config/api-opt',
-        component: _import('config/api-opt'),
-        name: 'config_api-opt',
-        meta: {
-          title: '第三方接口',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      }, {
-        path: '/config/api-edit/:type/:id',
-        component: _import('config/api-edit'),
-        name: 'config_api-edit',
-        meta: {
-          title: '编辑第三方接口',
-          highLight: '/config/api-opt',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-            {title: '第三方接口', path: '/config/api-opt'},
-          ],
-        },
-      },
-      {
-        path: '/config/sms',
-        component: _import('config/sms'),
-        name: 'config_sms',
-        meta: {
-          title: '短信配置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      },
-      {
-        path: '/config/transfer',
-        component: _import('config/transfer'),
-        name: 'config_transfer',
-        meta: {
-          title: '转账配置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      },
-      {
-        path: '/config/score',
-        component: _import('config/score'),
-        name: 'config_score',
-        meta: {
-          title: '积分配置',
-          breadcrumb: [
-            {title: '首页', path: '/dashboard/index'},
-            {title: '配置', path: '/config/index'},
-          ],
-        },
-      },
-    ]
-  }
-  // {
-  //     path: '/documentation',
-  //     component: Layout,
-  //     redirect: '/documentation/index',
-  //     children: [{
-  //         path: 'index',
-  //         component: _import('documentation/index'),
-  //         name: 'documentation',
-  //         meta: { title: 'documentation', icon: 'documentation', noCache: true }
-  //     }]
-  // }
-]
-
-export default new Router({
-  routes: constantRouterMap
-})
+import Vue from 'vue'
+import Router from 'vue-router'
+import layout from '../views/layout/layout'
+
+const _import = require('./_import_' + process.env.NODE_ENV)
+
+if(Router.version >= '3.1.0'){
+  const originalPush = Router.prototype.push
+  Router.prototype.push = function push(location) {
+    return originalPush.call(this, location).catch(err => err)
+  }
+}
+
+Vue.use(Router)
+
+export const constantRouterMap = [
+  {path: '/', redirect: '/login'},
+  {path: '/login', component: _import('login/index'), name: 'login'},
+  {path: '/modify-password/:adminName', component: _import('login/modify-password'), name: 'modify-password'},
+  // { path: '/authredirect', component: _import('login/authredirect'), hidden: true },
+  // { path: '/404', component: _import('errorPage/404'), hidden: true },
+  // { path: '/401', component: _import('errorPage/401'), hidden: true },
+  {
+    path: '/dashboard',
+    component: layout,
+    redirect: '/dashboard/index',
+    children: [{
+      path: '/dashboard/index',
+      component: _import('dashboard/index'),
+      name: 'dashboard_index',
+      meta: {
+        title: '控制台',
+        breadcrumb: [
+          {title: '首页', path: '/dashboard/index'},
+        ],
+      },
+    }]
+  },
+  {
+    path: '/shop',
+    component: layout,
+    redirect: '/shop/dec-order-list',
+    children: [
+      {
+        path: '/shop/dec-order-list',
+        component: _import('shop/dec-order-list'),
+        name: 'shop_dec-order-list',
+        meta: {
+          title: '报单列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '商城管理', path: '/shop/dec-order-list'},
+          ],
+        },
+      },
+      {
+        path: '/shop/order-list',
+        component: _import('shop/order-list'),
+        name: 'shop_order-list',
+        meta: {
+          title: '订单列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '商城管理', path: '/shop/dec-order-list'},
+          ],
+        },
+
+      },
+      {
+        path: '/shop/order-shop-list',
+        component: _import('shop/order-shop-list'),
+        name: 'shop_order_shop-list',
+        meta: {
+          title: '外部商城订单列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '商城管理', path: '/shop/dec-order-list'},
+          ],
+        },
+
+      },
+        {
+            path: '/shop/order-dec-list',
+            component: _import('shop/order-dec-list'),
+            name: 'shop_order_dec-list',
+            meta: {
+                title: '外部商城报单列表',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '商城管理', path: '/shop/dec-order-list'},
+                ],
+            },
+
+        },
+      {
+        path: '/shop/order-standard-list',
+        component: _import('shop/order-standard-list'),
+        name: 'shop_order_standard-list',
+        meta: {
+          title: '外部商城达标订单列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '商城管理', path: '/shop/dec-order-list'},
+          ],
+        },
+
+      },
+        {
+            path: '/shop/package',
+            component: _import('shop/package'),
+            name: 'shop_package',
+            meta: {
+                title: '报单套餐列表',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '商城管理', path: '/shop/dec-order-list'},
+                ],
+            },
+
+        },
+        {
+            path: '/shop/package-add',
+            component: _import('shop/package-add'),
+            name: 'shop_package-add',
+            meta: {
+                title: '报单套餐添加',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '商城管理', path: '/shop/dec-order-list'},
+                ],
+            },
+
+        },
+        {
+            path: '/shop/index',
+            component: _import('shop/index'),
+            name: 'shop_index',
+            meta: {
+                title: '商品列表',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '商城管理', path: '/shop/dec-order-list'},
+                ],
+            },
+
+        },
+        {
+            path: '/shop/goods-add',
+            component: _import('shop/goods-add'),
+            name: 'shop_goods-add',
+            meta: {
+                title: '商品添加',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '商城管理', path: '/shop/dec-order-list'},
+                ],
+            },
+
+        },
+    ],
+  },
+  {
+    path: '/user',
+    component: layout,
+    redirect: '/user/index',
+    children: [
+      {
+        path: '/user/index',
+        component: _import('user/index'),
+        name: 'user_index',
+        meta: {
+          title: '会员列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/user-add-opt',
+        component: _import('user/user-add-opt'),
+        name: 'user_user-add-opt',
+        meta: {
+          title: '空单操作',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+        {
+            path: '/user/empty-list',
+            component: _import('user/empty-list'),
+            name: 'user_empty_list',
+            meta: {
+                title: '空单列表',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '会员管理', path: '/user/index'},
+                ],
+            },
+        },
+      {
+        path: '/user/bind',
+        component: _import('user/bind'),
+        name: 'user_bind',
+        meta: {
+          title: '点位绑定',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/bind-add',
+        component: _import('user/bind-edit'),
+        name: 'user_bind-add',
+        meta: {
+          title: '添加点位绑定',
+          highLight: '/user/bind',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '点位绑定', path: '/user/bind'},
+          ],
+        },
+      },
+      {
+        path: '/user/bind-edit/:id',
+        component: _import('user/bind-edit'),
+        name: 'user_bind-edit',
+        meta: {
+          title: '编辑点位绑定',
+          highLight: '/user/bind',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '点位绑定', path: '/user/bind'},
+          ],
+        },
+      },
+      {
+        path: '/user/teamwork',
+        component: _import('user/teamwork'),
+        name: 'user_teamwork',
+        meta: {
+          title: '点位合作',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/teamwork-add',
+        component: _import('user/teamwork-edit'),
+        name: 'user_teamwork-add',
+        meta: {
+          title: '添加点位合作',
+          highLight: '/user/teamwork',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '点位合作', path: '/user/teamwork'},
+          ],
+        },
+      },
+      {
+        path: '/user/teamwork-edit/:id',
+        component: _import('user/teamwork-edit'),
+        name: 'user_teamwork-edit',
+        meta: {
+          title: '编辑点位合作',
+          highLight: '/user/teamwork',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '点位合作', path: '/user/teamwork'},
+          ],
+        },
+      },
+      {
+        path: '/user/system',
+        component: _import('user/system'),
+        name: 'user_system',
+        meta: {
+          title: '体系管理',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/system-add',
+        component: _import('user/system-edit'),
+        name: 'user_system-add',
+        meta: {
+          title: '添加体系',
+          highLight: '/user/system',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '体系管理', path: '/user/system'},
+          ],
+        },
+      },
+      {
+        path: '/user/system-edit/:id',
+        component: _import('user/system-edit'),
+        name: 'user_system-edit',
+        meta: {
+          title: '编辑体系',
+          highLight: '/user/system',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '体系管理', path: '/user/system'},
+          ],
+        },
+      },
+      {
+        path: '/user/group',
+        component: _import('user/group'),
+        name: 'user_group',
+        meta: {
+          title: '团队领导人列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/move',
+        component: _import('user/move'),
+        name: 'user_move',
+        meta: {
+          title: '移网管理',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/move-add',
+        component: _import('user/move-add'),
+        name: 'user_move-add',
+        meta: {
+          title: '申请移网',
+          highLight: '/user/move',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '移网管理', path: '/user/move'},
+          ],
+        },
+      },
+      {
+        path: '/user/reg-info',
+        component: _import('user/reg-info'),
+        name: 'user_reg-info',
+        meta: {
+          title: '注册信息报表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/reg-info-audit',
+        component: _import('user/reg-info-audit'),
+        name: 'user_reg-info-audit',
+        meta: {
+          title: '注册信息审核',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/reg-info-audit-add-opt/:id?',
+        component: _import('user/reg-info-audit-add-opt'),
+        name: 'user_reg-info-audit-add-opt',
+        meta: {
+          title: '注册信息添加操作',
+          highLight: '/user/reg-info-audit',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '注册信息审核', path: '/user/reg-info-audit'},
+          ],
+        },
+      },
+      {
+        path: '/user/status-audit-list',
+        component: _import('user/status-audit-list'),
+        name: 'user_status-audit-list',
+        meta: {
+          title: '会员状态管理',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/status-audit-add',
+        component: _import('user/status-audit-add'),
+        name: 'user_status-audit-add',
+        meta: {
+          title: '申请修改会员状态',
+          highLight: '/user/status-audit-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '会员状态管理', path: '/user/status-audit-list'},
+          ],
+        },
+      },
+      {
+        path: '/user/status-audit-add/:userName',
+        component: _import('user/status-audit-add'),
+        name: 'user_status-audit-add-username',
+        meta: {
+          title: '申请修改会员状态',
+          highLight: '/user/status-audit-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+            {title: '会员状态管理', path: '/user/status-audit-list'},
+          ],
+        },
+      },
+        {
+            path: '/user/dec-level-list',
+            component: _import('user/dec-level-list'),
+            name: 'user_dec-level-list',
+            meta: {
+                title: '会员级别调整列表',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '会员管理', path: '/user/index'},
+                ],
+            },
+        },
+      {
+        path: '/user/change-user-dec-level',
+        component: _import('user/change-user-dec-level'),
+        name: 'user_change-user-dec-level',
+        meta: {
+          title: '修改会员级别',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/change-user-dec-role',
+        component: _import('user/change-user-dec-role'),
+        name: 'user_change-user-dec-role',
+        meta: {
+          title: '修改报单中心级别',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/year-highest-emp-lv',
+        component: _import('user/year-highest-emp-lv'),
+        name: 'user_year-highest-emp-lv',
+        meta: {
+          title: '会员历史年度最高聘级表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+      {
+        path: '/user/change-show-emp-level',
+        component: _import('user/change-show-emp-level'),
+        name: 'user_change-show-emp-level',
+        meta: {
+          title: '修改会员前台显示聘级',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '会员管理', path: '/user/index'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/atlas',
+    component: layout,
+    redirect: '/atlas/relation-opt',
+    children: [
+      {
+        path: '/atlas/relation-opt',
+        component: _import('atlas/relation-opt'),
+        name: 'atlas_relation-opt',
+        meta: {
+          title: '开拓网络',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '网络图谱', path: '/atlas/relation-opt'},
+          ],
+        },
+      },
+      {
+        path: '/atlas/network-opt',
+        component: _import('atlas/network-opt'),
+        name: 'atlas_network-opt',
+        meta: {
+          title: '安置网络',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '网络图谱', path: '/atlas/relation-opt'},
+          ],
+        },
+      },
+      {
+        path: '/atlas/network-line-opt',
+        component: _import('atlas/network-line-opt'),
+        name: 'atlas_network-line-opt',
+        meta: {
+          title: '安置链路',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '网络图谱', path: '/atlas/relation-opt'},
+          ],
+        },
+      },
+      {
+        path: '/atlas/emp-user-line',
+        component: _import('atlas/emp-user-line'),
+        name: 'atlas_emp-user-line',
+        meta: {
+          title: '聘级网络',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '网络图谱', path: '/atlas/relation-opt'},
+          ],
+        },
+      },
+      // {
+      //   path: '/atlas/emp-user-list',
+      //   component: _import('atlas/emp-user-list'),
+      //   name: 'atlas_emp-user-list',
+      //   meta: {
+      //     title: '聘级网络列表',
+      //     breadcrumb: [
+      //       {title: '首页', path: '/dashboard/index'},
+      //       {title: '网络图谱', path: '/atlas/relation-opt'},
+      //     ],
+      //   },
+      // },
+
+
+    ]
+  },
+  {
+    path: '/reconsume',
+    component: layout,
+    redirect: '/reconsume/pool-list',
+    children: [
+      {
+        path: '/reconsume/pool-list',
+        component: _import('reconsume/pool-list'),
+        name: 'reconsume_pool-list',
+        meta: {
+          title: '复销池余额列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '复销管理', path: '/reconsume/pool-list'},
+          ],
+        },
+      },
+      {
+        path: '/reconsume/deduct',
+        component: _import('reconsume/deduct'),
+        name: 'reconsume_deduct',
+        meta: {
+          title: '手动扣除月复销',
+          highLight: '/reconsume/deduct',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '复销管理', path: '/reconsume/pool-list'},
+          ],
+        },
+      },
+      {
+        path: '/reconsume/change-audit-list',
+        component: _import('reconsume/change-audit-list'),
+        name: 'reconsume_change-audit-list',
+        meta: {
+          title: '复销余额调整审核',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '复销管理', path: '/reconsume/pool-list'},
+          ],
+        },
+      },
+      {
+        path: '/reconsume/change-audit-add/:userName?',
+        component: _import('reconsume/change-audit-add'),
+        name: 'reconsume_change-audit-add',
+        meta: {
+          title: '申请调整复销池余额',
+          highLight: '/reconsume/change-audit-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '复销管理', path: '/reconsume/pool-list'},
+            {title: '复销余额调整审核', path: '/reconsume/change-audit-list'},
+          ],
+        },
+      },
+      {
+        path: '/reconsume/deduct-audit-list',
+        component: _import('reconsume/deduct-audit-list'),
+        name: 'reconsume_deduct-audit-list',
+        meta: {
+          title: '扣除复销审核',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '复销管理', path: '/reconsume/pool-list'},
+          ],
+        },
+      },
+      {
+        path: '/reconsume/deduct-audit-add',
+        component: _import('reconsume/deduct-audit-add'),
+        name: 'reconsume_deduct-audit-add',
+        meta: {
+          title: '手动扣除月复销',
+          highLight: '/reconsume/deduct-audit-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '复销管理', path: '/reconsume/pool-list'},
+          ],
+        },
+      },
+      {
+        path: '/reconsume/flow-list',
+        component: _import('reconsume/flow-list'),
+        name: 'reconsume_flow-list',
+        meta: {
+          title: '复销流水',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '复销管理', path: '/reconsume/pool-list'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/bonus',
+    component: layout,
+    redirect: '/bonus/period',
+    children: [
+      {
+        path: '/bonus/period',
+        component: _import('bonus/period'),
+        name: 'bonus_period',
+        meta: {
+          title: '封期管理',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/balance-list',
+        component: _import('bonus/balance-list'),
+        name: 'bonus_balance-list',
+        meta: {
+          title: '会员奖金余额',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+
+      {
+        path: '/bonus/period-detail/:periodNum',
+        component: _import('bonus/period-detail'),
+        name: 'bonus_period-detail',
+        meta: {
+          title: '期奖金明细',
+          highLight: '/bonus/period',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+            {title: '封期管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/new-period-bonus',
+        component: _import('bonus/new-period-bonus'),
+        name: 'bonus_new-period-bonus',
+        meta: {
+          title: '最新奖金',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/other-period-bonus',
+        component: _import('bonus/other-period-bonus'),
+        name: 'bonus_other-period-bonus',
+        meta: {
+          title: '往期奖金',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/flow-bonus',
+        component: _import('bonus/flow-bonus'),
+        name: 'bonus_flow-bonus',
+        meta: {
+          title: '奖金流水',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/flow-rp',
+        component: _import('bonus/flow-rp'),
+        name: 'bonus_flow-rp',
+        meta: {
+          title: '复消积分流水',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/flow-balance',
+        component: _import('bonus/flow-balance'),
+        name: 'bonus_flow-balance',
+        meta: {
+          title: '用户余额流水',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/flow-exchange',
+        component: _import('bonus/flow-exchange'),
+        name: 'bonus_flow-exchange',
+        meta: {
+          title: '兑换点数流水',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/flow-lx',
+        component: _import('bonus/flow-lx'),
+        name: 'bonus_flow-lx',
+        meta: {
+          title: '领袖分红奖流水',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/cf-lx-audit-list',
+        component: _import('bonus/cf-lx-audit-list'),
+        name: 'bonus_cf-lx-audit-list',
+        meta: {
+          title: '年度奖金发放审核',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/cf-lx-apply',
+        component: _import('bonus/cf-lx-apply'),
+        name: 'bonus_cf-lx-apply',
+        meta: {
+          title: '申请发放年度奖',
+          highLight: '/bonus/cf-lx-audit-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+            {title: '年度奖金发放审核', path: '/bonus/cf-lx-audit-list'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/perf',
+        component: _import('bonus/perf'),
+        name: 'bonus_perf',
+        meta: {
+          title: '业绩管理',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/calc-qy',
+        component: _import('bonus/calc-qy'),
+        name: 'bonus_calc-qy',
+        meta: {
+          title: '区域津贴核算',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/resend-qy-list',
+        component: _import('bonus/resend-qy-list'),
+        name: 'bonus_resend-qy-list',
+        meta: {
+          title: '区域津贴补发列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/resend-qy-audit-list',
+        component: _import('bonus/resend-qy-audit-list'),
+        name: 'bonus_resend-qy-audit-list',
+        meta: {
+          title: '补发区域津贴审核列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/trace-down-qy',
+        component: _import('bonus/trace-down-qy'),
+        name: 'bonus_trace-down-qy',
+        meta: {
+          title: '团队奖向下追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/trace-up-qy',
+        component: _import('bonus/trace-up-qy'),
+        name: 'bonus_trace-up-qy',
+        meta: {
+          title: '团队奖向上追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/trace-down-yc',
+        component: _import('bonus/trace-down-yc'),
+        name: 'bonus_trace-down-yc',
+        meta: {
+          title: '荣衔奖向下追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/trace-up-yc',
+        component: _import('bonus/trace-up-yc'),
+        name: 'bonus_trace-up-yc',
+        meta: {
+          title: '荣衔奖向上追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+          path: '/bonus/trace-down-bd',
+          component: _import('bonus/trace-down-bd'),
+          name: 'bonus_trace-down-bd',
+          meta: {
+              title: '报单奖向下追溯',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+          path: '/bonus/trace-up-bd',
+          component: _import('bonus/trace-up-bd'),
+          name: 'bonus_trace-up-bd',
+          meta: {
+              title: '报单奖向上追溯',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+          path: '/bonus/trace-down-tg',
+          component: _import('bonus/trace-down-tg'),
+          name: 'bonus_trace-down-tg',
+          meta: {
+              title: '推广奖向下追溯',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+          path: '/bonus/trace-up-tg',
+          component: _import('bonus/trace-up-tg'),
+          name: 'bonus_trace-up-tg',
+          meta: {
+              title: '推广奖向上追溯',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+        path: '/bonus/trace-down-xf',
+        component: _import('bonus/trace-down-xf'),
+        name: 'bonus_trace-down-xf',
+        meta: {
+          title: '消费奖向下追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/trace-up-xf',
+        component: _import('bonus/trace-up-xf'),
+        name: 'bonus_trace-up-xf',
+        meta: {
+          title: '消费奖向上追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+          path: '/bonus/trace-down-yj',
+          component: _import('bonus/trace-down-yj'),
+          name: 'bonus_trace-down-yj',
+          meta: {
+              title: '业绩奖向下追溯',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+          path: '/bonus/trace-up-yj',
+          component: _import('bonus/trace-up-yj'),
+          name: 'bonus_trace-up-yj',
+          meta: {
+              title: '业绩奖向上追溯',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+          path: '/bonus/trace-down-gx',
+          component: _import('bonus/trace-down-gx'),
+          name: 'bonus_trace-down-gx',
+          meta: {
+              title: '共享奖向下追溯',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+          path: '/bonus/trace-up-gx',
+          component: _import('bonus/trace-up-gx'),
+          name: 'bonus_trace-up-gx',
+          meta: {
+              title: '共享奖向上追溯',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+          path: '/bonus/trace-down-gl',
+          component: _import('bonus/trace-down-gl'),
+          name: 'bonus_trace-down-gl',
+          meta: {
+              title: '管理奖向下追溯',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+          path: '/bonus/trace-up-gl',
+          component: _import('bonus/trace-up-gl'),
+          name: 'bonus_trace-up-gl',
+          meta: {
+              title: '管理奖向上追溯',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+        path: '/bonus/trace-down-fx',
+        component: _import('bonus/trace-down-fx'),
+        name: 'bonus_trace-down-fx',
+        meta: {
+          title: '复销奖向下追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/trace-up-fx',
+        component: _import('bonus/trace-up-fx'),
+        name: 'bonus_trace-up-fx',
+        meta: {
+          title: '复销奖向上追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/trace-bt',
+        component: _import('bonus/trace-bt'),
+        name: 'bonus_trace-bt',
+        meta: {
+          title: '报单中心补贴追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/trace-fl',
+        component: _import('bonus/trace-fl'),
+        name: 'bonus_trace-fl',
+        meta: {
+          title: '报单中心货补追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/trace-fw',
+        component: _import('bonus/trace-fw'),
+        name: 'bonus_trace-fw',
+        meta: {
+          title: '区域业绩提成追溯',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/perf-order',
+        component: _import('bonus/perf-order'),
+        name: 'bonus_perf-order',
+        meta: {
+          title: '业绩单',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/perf-period-list',
+        component: _import('bonus/perf-period-list'),
+        name: 'bonus_perf-period-list',
+        meta: {
+          title: '期业绩',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+          path: '/bonus/perf-month',
+          component: _import('bonus/perf-month'),
+          name: 'bonus_perf-month',
+          meta: {
+              title: '月业绩',
+              breadcrumb: [
+                  {title: '首页', path: '/dashboard/index'},
+                  {title: '奖金管理', path: '/bonus/period'},
+              ],
+          },
+      },
+      {
+        path: '/bonus/perf-standard',
+        component: _import('bonus/perf-standard'),
+        name: 'bonus_perf-standard',
+        meta: {
+          title: '达标业绩',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/score-month',
+        component: _import('bonus/score-month'),
+        name: 'bonus_score-month',
+        meta: {
+          title: '月积分',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/real-time-perf',
+        component: _import('bonus/real-time-perf'),
+        name: 'bonus_real-time-perf',
+        meta: {
+          title: '会员实时业绩',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/yc-perf',
+        component: _import('bonus/yc-perf'),
+        name: 'bonus_yc-perf',
+        meta: {
+          title: '荣衔业绩',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+      {
+        path: '/bonus/user-perf',
+        component: _import('bonus/user-perf'),
+        name: 'leo-user-perf-table',
+        meta: {
+          title: '用户业绩',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '奖金管理', path: '/bonus/period'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/report',
+    component: layout,
+    redirect: '/report/dec',
+    children: [
+      {
+        path: '/report/dec',
+        component: _import('report/dec'),
+        name: 'report_dec',
+        meta: {
+          title: '报单查询',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '报表管理', path: '/report/dec'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/finance',
+    component: layout,
+    redirect: '/finance/balance-audit-list',
+    children: [
+      {
+        path: '/finance/balance-audit-list',
+        component: _import('finance/balance-audit-list'),
+        name: 'finance_balance-audit-list',
+        meta: {
+          title: '会员余额调整列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/balance-audit-list'},
+          ],
+        },
+      },
+      {
+        path: '/finance/change-balance-opt',
+        component: _import('finance/change-balance-opt'),
+        name: 'finance_change-balance-opt',
+        meta: {
+          title: '申请调整会员余额',
+          highLight: '/finance/balance-audit-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/balance-audit-list'},
+            {title: '会员余额调整列表', path: '/finance/balance-audit-list'},
+          ],
+        },
+      },
+      {
+        path: '/finance/dec-list',
+        component: _import('finance/dec-list'),
+        name: 'finance_dec-list',
+        meta: {
+          title: '报单订货单列表',
+          highLight: '/finance/dec-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/balance-audit-list'},
+          ],
+        },
+      },
+      {
+        path: '/finance/transfer-list',
+        component: _import('finance/transfer-list'),
+        name: 'finance_transfer-list',
+        meta: {
+          title: '转账记录列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/balance-audit-list'},
+          ],
+        },
+      },
+      {
+        path: '/finance/withdraw',
+        component: _import('finance/withdraw'),
+        name: 'finance_withdraw',
+        meta: {
+          title: '提现管理',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '提现管理', path: '/finance/withdraw'},
+          ],
+        },
+      },
+      {
+        path: '/finance/withdraw-add',
+        component: _import('finance/withdraw-add'),
+        name: 'finance_withdraw-add',
+        meta: {
+          title: '新增提现',
+          highLight: '/finance/withdraw',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '提现管理', path: '/finance/withdraw'},
+            {title: '新增提现', path: '/finance/withdraw-add'},
+          ],
+        },
+      },
+      {
+        path: '/finance/invoice-audit',
+        component: _import('finance/invoice-audit'),
+        name: 'finance_invoice-audit',
+        meta: {
+          title: '发票管理',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '发票管理', path: '/finance/invoice-audit'},
+          ],
+        },
+      },
+      {
+        path: '/finance/perf-audit-list',
+        component: _import('finance/perf-audit-list'),
+        name: 'finance_perf-audit-list',
+        meta: {
+          title: '会员业绩调整列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/balance-audit-list'},
+          ],
+        },
+      },
+      {
+        path: '/finance/perf-apply',
+        component: _import('finance/perf-apply'),
+        name: 'finance_perf-apply',
+        meta: {
+          title: '调整会员业绩',
+          highLight: '/finance/perf-audit-list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/balance-audit-list'},
+            {title: '调整会员业绩', path: '/finance/perf-audit-list'},
+          ],
+        },
+      },
+      {
+        path: '/finance/deal-type',
+        component: _import('finance/deal-type'),
+        name: 'finance_deal-type',
+        meta: {
+          title: '交易类型',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '交易类型', path: '/finance/deal-type'},
+          ],
+        },
+      },
+      {
+        path: '/finance/deal-type-add',
+        component: _import('finance/deal-type-add'),
+        name: 'finance_deal-type-add',
+        meta: {
+          title: '交易类型添加',
+          highLight: '/finance/deal-type',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '交易类型', path: '/finance/deal-type'},
+            {title: '交易类型添加', path: '/finance/deal-type-add'},
+          ],
+        },
+      },
+      {
+        path: '/finance/history-bonus',
+        component: _import('finance/history-bonus'),
+        name: 'finance_history-bonus',
+        meta: {
+          title: '历史奖金余额',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '财务管理', path: '/finance/balance-audit-list'},
+          ],
+        },
+      },
+        {
+            path: '/finance/recharge',
+            component: _import('finance/recharge'),
+            name: 'finance_recharge',
+            meta: {
+                title: '充值管理',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '财务管理', path: '/finance/balance-audit-list'},
+                ],
+            },
+        },
+        {
+            path: '/finance/recharge-status',
+            component: _import('finance/recharge-status'),
+            name: 'finance_recharge-status',
+            meta: {
+                title: '状态管理',
+                breadcrumb: [
+                    {title: '首页', path: '/dashboard/index'},
+                    {title: '财务管理', path: '/finance/balance-audit-list'},
+                ],
+            },
+        },
+    ]
+  },
+  {
+    path: '/article',
+    component: layout,
+    redirect: '/article/category',
+    children: [
+      {
+        path: '/article/category',
+        component: _import('article/category'),
+        name: 'article_category',
+        meta: {
+          title: '分类管理',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '分类管理', path: '/article/category'},
+          ],
+        },
+      },
+      {
+        path: '/article/category-add',
+        component: _import('article/category-add'),
+        name: 'article_category-add',
+        meta: {
+          title: '添加分类',
+          highLight: '/article/category-add',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '分类管理', path: '/article/category'},
+            {title: '添加分类', path: '/article/category-add'},
+          ],
+        },
+      },
+      {
+        path: '/article/index',
+        component: _import('article/index'),
+        name: 'article_index',
+        meta: {
+          title: '文章列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '文章列表', path: '/article/index'},
+          ],
+        },
+      },
+      {
+        path: '/article/add',
+        component: _import('article/edit'),
+        name: 'article_add',
+        meta: {
+          title: '添加文章',
+          highLight: '/article/index',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '文章列表', path: '/article/index'},
+            {title: '添加文章', path: '/article/add'},
+          ],
+        },
+      },
+      {
+        path: '/article/edit/:id',
+        component: _import('article/edit'),
+        name: 'article_edit',
+        meta: {
+          title: '编辑文章',
+          highLight: '/article/index',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '文章列表', path: '/article/index'},
+            {title: '编辑文章', path: '/article/edit'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/message',
+    component: layout,
+    redirect: '/message/list',
+    children: [
+      {
+        path: '/message/list',
+        component: _import('message/list'),
+        name: 'message_list',
+        meta: {
+          title: '站内信列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '站内信管理', path: '/message/list'},
+          ],
+        },
+      },
+      {
+        path: '/message/add',
+        component: _import('message/edit'),
+        name: 'message_add',
+        meta: {
+          title: '添加站内信',
+          highLight: '/message/list',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '站内信管理', path: '/message/list'},
+            {title: '站内信列表', path: '/message/list'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/file',
+    component: layout,
+    redirect: '/file/export',
+    children: [
+      {
+        path: '/file/export',
+        component: _import('file/export'),
+        name: 'file_export',
+        meta: {
+          title: '导出文件',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '文件管理', path: '/bonus/period'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/admin',
+    component: layout,
+    redirect: '/admin/index',
+    children: [
+      {
+        path: '/admin/change-password',
+        component: _import('admin/edit'),
+        name: 'admin_change-password',
+        meta: {
+          title: '重置密码',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '管理员管理', path: '/admin/index'},
+          ],
+        },
+      },
+      {
+        path: '/admin/index',
+        component: _import('admin/index'),
+        name: 'admin_index',
+        meta: {
+          title: '管理员列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '管理员管理', path: '/admin/index'},
+          ],
+        },
+      }, {
+        path: '/admin/add',
+        component: _import('admin/edit'),
+        name: 'admin_add',
+        meta: {
+          title: '添加管理员',
+          highLight: '/admin/index',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '管理员管理', path: '/admin/index'},
+            {title: '管理员列表', path: '/admin/index'},
+          ],
+        },
+      }, {
+        path: '/admin/edit/:id',
+        component: _import('admin/edit'),
+        name: 'admin_edit',
+        meta: {
+          title: '编辑管理员',
+          highLight: '/admin/index',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '管理员管理', path: '/admin/index'},
+            {title: '管理员列表', path: '/admin/index'},
+          ],
+        },
+      }, {
+        path: '/admin/role',
+        component: _import('admin/role'),
+        name: 'admin_role',
+        meta: {
+          title: '管理员角色列表',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '管理员管理', path: '/admin/index'},
+          ],
+        },
+      }, {
+        path: '/admin/role-add',
+        component: _import('admin/role-add'),
+        name: 'admin_role-add',
+        meta: {
+          title: '添加管理员角色',
+          highLight: '/admin/role',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '管理员管理', path: '/admin/index'},
+            {title: '管理员角色列表', path: '/admin/role'},
+          ],
+        },
+      },{
+        path: '/admin/role-edit/:id',
+        component: _import('admin/role-add'),
+        name: 'admin_role-edit',
+        meta: {
+          title: '编辑管理员角色',
+          highLight: '/admin/role',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '管理员管理', path: '/admin/index'},
+            {title: '管理员角色列表', path: '/admin/role'},
+          ],
+        },
+      }, {
+        path: '/admin/role-permission/:id',
+        component: _import('admin/role-permission'),
+        name: 'admin_role-permission',
+        meta: {
+          title: '管理员角色权限',
+          highLight: '/admin/role',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '管理员管理', path: '/admin/index'},
+            {title: '管理员角色列表', path: '/admin/role'},
+          ],
+        },
+      }, {
+        path: '/admin/role-column/:id',
+        component: _import('admin/role-column'),
+        name: 'admin_role-column',
+        meta: {
+          title: '管理员角色列表字段权限',
+          highLight: '/admin/role',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '管理员管理', path: '/admin/index'},
+            {title: '管理员角色列表', path: '/admin/role'},
+          ],
+        },
+      }, {
+        path: '/admin/test',
+        component: _import('admin/test'),
+        name: 'admin_test',
+      }]
+  },
+  {
+    path: '/ad',
+    component: layout,
+    redirect: '/ad/location',
+    children: [
+      {
+        path: '/ad/location',
+        component: _import('ad/location'),
+        name: 'ad_location',
+        meta: {
+          title: '广告位',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '广告管理', path: '/ad/location'},
+          ],
+        },
+      },
+      {
+        path: '/ad/list/:lid',
+        component: _import('ad/list'),
+        name: 'ad_list',
+        meta: {
+          title: '广告列表',
+          highLight: '/ad/location',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '广告管理', path: '/ad/location'},
+            {title: '广告位', path: '/ad/location'},
+          ],
+        },
+      },
+      {
+        path: '/ad/add',
+        component: _import('ad/edit'),
+        name: 'ad_add',
+        meta: {
+          title: '添加广告',
+          highLight: '/ad/location',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '广告管理', path: '/ad/location'},
+            {title: '广告位', path: '/ad/location'},
+          ],
+        },
+      },
+      {
+        path: '/ad/edit/:id',
+        component: _import('ad/edit'),
+        name: 'ad_edit',
+        meta: {
+          title: '编辑广告',
+          highLight: '/ad/location',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '广告管理', path: '/ad/location'},
+            {title: '广告位', path: '/ad/location'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/log',
+    component: layout,
+    redirect: '/log/admin-login',
+    children: [
+      {
+        path: '/log/admin-login',
+        component: _import('log/admin-login'),
+        name: 'log_admin-login',
+        meta: {
+          title: '管理员登录日志',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '日志管理', path: '/log/admin-login'},
+          ],
+        },
+      },
+      {
+        path: '/log/user-login',
+        component: _import('log/user-login'),
+        name: 'log_user-login',
+        meta: {
+          title: '会员登录日志',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '日志管理', path: '/log/user-login'},
+          ],
+        },
+      },
+      {
+        path: '/log/admin-handle',
+        component: _import('log/admin-handle'),
+        name: 'log_admin-handle',
+        meta: {
+          title: '管理员操作日志',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '日志管理', path: '/log/admin-login'},
+          ],
+        },
+      },
+      {
+        path: '/log/user-handle',
+        component: _import('log/user-handle'),
+        name: 'log_user-handle',
+        meta: {
+          title: '会员操作日志',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '日志管理', path: '/log/admin-login'},
+          ],
+        },
+      },
+      {
+        path: '/log/system',
+        component: _import('log/system'),
+        name: 'log_system',
+        meta: {
+          title: '系统日志',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '日志管理', path: '/log/admin-login'},
+          ],
+        },
+      },
+    ]
+  },
+  {
+    path: '/config',
+    component: layout,
+    redirect: '/config/base',
+    children: [
+      {
+        path: '/config/base',
+        component: _import('config/base'),
+        name: 'config_base',
+        meta: {
+          title: '站点设置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/base'},
+          ],
+        },
+      }, {
+        path: '/config/period',
+        component: _import('config/period'),
+        name: 'config_period',
+        meta: {
+          title: '期数配置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      }, {
+        path: '/config/other',
+        component: _import('config/other'),
+        name: 'config_other',
+        meta: {
+          title: '其他配置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      }, {
+        path: '/config/dec-level',
+        component: _import('config/dec-level'),
+        name: 'config_dec-level',
+        meta: {
+          title: '会员级别配置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      }, {
+        path: '/config/dec-level-add',
+        component: _import('config/dec-level-edit'),
+        name: 'config_dec-level-add',
+        meta: {
+          title: '添加会员级别',
+          highLight: '/config/dec-level',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+            {title: '会员级别配置', path: '/config/dec-level'},
+          ],
+        },
+      }, {
+        path: '/config/dec-level-edit/:id',
+        component: _import('config/dec-level-edit'),
+        name: 'config_dec-level-edit',
+        meta: {
+          title: '编辑会员级别',
+          highLight: '/config/dec-level',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+            {title: '会员级别配置', path: '/config/dec-level'},
+          ],
+        },
+      }, {
+        path: '/config/dec-role',
+        component: _import('config/dec-role'),
+        name: 'config_dec-role',
+        meta: {
+          title: '报单中心级别配置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      }, {
+        path: '/config/dec-role-edit/:id',
+        component: _import('config/dec-role-edit'),
+        name: 'config_dec-role-edit',
+        meta: {
+          title: '编辑报单中心级别',
+          highLight: '/config/dec-role',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+            {title: '报单中心级别配置', path: '/config/dec-role'},
+          ],
+        },
+      }, {
+        path: '/config/emp-level',
+        component: _import('config/emp-level'),
+        name: 'config_emp-level',
+        meta: {
+          title: '会员聘级配置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      }, {
+        path: '/config/emp-level-add',
+        component: _import('config/emp-level-edit'),
+        name: 'config_emp-level-add',
+        meta: {
+          title: '添加聘级',
+          highLight: '/config/emp-level',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+            {title: '聘级管理', path: '/config/emp-level'},
+          ],
+        },
+      }, {
+        path: '/config/emp-level-edit/:id',
+        component: _import('config/emp-level-edit'),
+        name: 'config_emp-level-edit',
+        meta: {
+          title: '编辑聘级',
+          highLight: '/config/emp-level',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+            {title: '聘级管理', path: '/config/emp-level'},
+          ],
+        },
+      }, {
+        path: '/config/reg-type',
+        component: _import('config/reg-type'),
+        name: 'config_reg-type',
+        meta: {
+          title: '会员注册类型配置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      }, {
+        path: '/config/bonus-opt',
+        component: _import('config/bonus-opt'),
+        name: 'config_bonus-opt',
+        meta: {
+          title: '奖金设置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      }, {
+        path: '/config/clear-data',
+        component: _import('config/clear-data'),
+        name: 'config_clear-data',
+        meta: {
+          title: '清空数据',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      }, {
+        path: '/config/api-opt',
+        component: _import('config/api-opt'),
+        name: 'config_api-opt',
+        meta: {
+          title: '第三方接口',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      }, {
+        path: '/config/api-edit/:type/:id',
+        component: _import('config/api-edit'),
+        name: 'config_api-edit',
+        meta: {
+          title: '编辑第三方接口',
+          highLight: '/config/api-opt',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+            {title: '第三方接口', path: '/config/api-opt'},
+          ],
+        },
+      },
+      {
+        path: '/config/sms',
+        component: _import('config/sms'),
+        name: 'config_sms',
+        meta: {
+          title: '短信配置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      },
+      {
+        path: '/config/transfer',
+        component: _import('config/transfer'),
+        name: 'config_transfer',
+        meta: {
+          title: '转账配置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      },
+      {
+        path: '/config/score',
+        component: _import('config/score'),
+        name: 'config_score',
+        meta: {
+          title: '积分配置',
+          breadcrumb: [
+            {title: '首页', path: '/dashboard/index'},
+            {title: '配置', path: '/config/index'},
+          ],
+        },
+      },
+    ]
+  }
+  // {
+  //     path: '/documentation',
+  //     component: Layout,
+  //     redirect: '/documentation/index',
+  //     children: [{
+  //         path: 'index',
+  //         component: _import('documentation/index'),
+  //         name: 'documentation',
+  //         meta: { title: 'documentation', icon: 'documentation', noCache: true }
+  //     }]
+  // }
+]
+
+export default new Router({
+  routes: constantRouterMap
+})

+ 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

+ 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',
+        ],
+    ],
+];

+ 327 - 327
common/config/params.php

@@ -1,327 +1,327 @@
-<?php
-$nationParams = require_once __DIR__ . '/params-nation.php';
-return [
-    'adminEmail' => 'admin@example.com',
-    'supportEmail' => 'support@example.com',
-    'nation' => $nationParams,
-    'backAccessTokenExpiresIn' => 3000 * 60,
-    'backRefreshTokenExpiresIn' => 3000 * 60 * 60,
-    'frontAccessTokenExpiresIn' => 3000 * 60,
-    'frontRefreshTokenExpiresIn' => 3000 * 60 * 60,
-    'user.passwordResetTokenExpire' => 3600,
-    'operationTimeOut' => 15 * 60,     // 这里设置的15分钟超时
-    'pageSize' => 20,
-    'http' => [
-        'shopApi' => [
-            'authKey' => 'sErypUtORfuloNdiTYLINArdtHErSAnDkiRPRElTaiNgIneUSEardopEnTAcErNO',
-            'timeDiff' => 0,
-        ],
-        'remoteUploadApi' => [
-            'authKey' => 'k4Ao7KWVbvg3Z2L6KLwN9OoDjQL5SioJffIPoODATxCynuEVEAt0278kg7r9FHiS',
-            'host' => $mainConfig['remoteUploadHost'],
-            'remoteUploadNotifyUrl' => '',
-        ],
-        'backendToFrontendApi' => [
-            'authKey' => 'hYkDsjhj6CfGMKbRMjoKtMauMEHiufyikGmziqy2anXYTMXhsUkrPC6YbvyHmdLD',
-            'timeDiff' => 0,
-        ],
-        'lingYunGongApi' => [
-            'host' => $mainConfig['idCardVerify']['host'],
-            'authToken' => [
-                'path' => '/uaa/v1/auth/tokens',
-                'clientId' => $mainConfig['idCardVerify']['clientId'],
-            ],
-            'hasIdCardInfoPath' => '/socialwork/v1/external/freedom-emps/has-idcard-info/%s',
-        ]
-//        'requestShop' => [
-//            'url' => $mainConfig['requestShopUrl'],
-//            'username' => 'bonus_api',
-//            'password' => 'bonus_api',
-//        ]
-
-    ],
-    'shopWalletType' => [
-        'cash' =>[
-            'value'=>'cash',
-            'title'=>'现金钱包',
-        ],
-    ],
-    'shopFlowType' => [
-        'remit' => [
-            'value' => 'remit',
-            'label' => '汇款充值',
-        ],
-        'recharge' => [
-            'value' => 'recharge',
-            'label' => '第三方充值',
-        ],
-        'transfer_out' => [
-            'value' => 'transfer_out',
-            'label' => '转出',
-        ],
-        'transfer_in' => [
-            'value' => 'transfer_in',
-            'label' => '转入',
-        ],
-        'pay' => [
-            'value' => 'pay',
-            'label' => '支付',
-        ],
-        'decRecharge' => [
-            'value' => 'decRecharge',
-            'label' => '报单充入',
-        ],
-        'orderRecharge' => [
-            'value' => 'orderRecharge',
-            'label' => '订货充入',
-        ],
-        'freight' => [
-            'value' => 'freight',
-            'label' => '支付运费',
-        ],
-        'adjust_recharge' => [
-            'value' => 'adjust_recharge',
-            'label' => '待调整充入',
-        ],
-        'adjust_deduct' => [
-            'value' => 'adjust_deduct',
-            'label' => '待调整扣除',
-        ],
-        'adjust_transfer_out' => [
-            'value' => 'adjust_transfer_out',
-            'label' => '待调整转出',
-        ],
-        'adjust_transfer_in' => [
-            'value' => 'adjust_transfer_in',
-            'label' => '待调整转入',
-        ],
-        'exchange_recharge' => [
-            'value' => 'exchange_recharge',
-            'label' => '换货充入',
-        ],
-        'exchange_deduct' => [
-            'value' => 'exchange_deduct',
-            'label' => '换货扣除',
-        ],
-        'delete_order_deduct' => [
-            'value' => 'delete_order_deduct',
-            'label' => '删单自动扣除',
-        ],
-        'delete_order_recharge' => [
-            'value' => 'delete_order_recharge',
-            'label' => '删单自动充入',
-        ],
-        'delete_order_return' => [
-            'value' => 'delete_order_return',
-            'label' => '删单扣回',
-        ],
-        'repair_pay' => [
-            'value' => 'repair_pay',
-            'label' => '支付维修费',
-        ],
-        'after_sale_exchange_recharge' => [
-            'value' => 'after_sale_exchange_recharge',
-            'label' => '售后调货充入',
-        ],
-        'after_sale_exchange_deduct' => [
-            'value' => 'after_sale_exchange_deduct',
-            'label' => '售后调货扣费',
-        ],
-        'oms_deduct' => [
-            'value' => 'oms_deduct',
-            'label' => 'OMS扣款',
-        ],
-        'deduct' => [
-            'value' => 'deduct',
-            'label' => '扣除',
-        ],
-        'incr' => [
-            'value' => 'incr',
-            'label' => '增加',
-        ],
-        'other' => [
-            'value' => 'other',
-            'label' => '其它',
-        ],
-        'handle' => [
-            'value' => 'handle',
-            'label' => '管理员手动调整',
-        ],
-    ],
-    'enableLog' => true,
-    'isRemoteUpload' => false, // 是否上传至远程
-    'excelLocalDir' => 'excel_export', // 是否上传至远程
-    'superAdminRoleId' => '666A7F102B8D6C66E055736AECE8644D',
-    'mainAdminId' => '65F27BCE7FD278FFE055736AECE8644D',
-    'mainUserId' => '670B84FD7C216D4EE055736AECE8644D',
-    'hbCouponsProId' => '1000000000', // 货补优惠券
-    'storeDecRoleId' => '8976C62F40064D8AB357BE07C8A3CA8F', // 报单中心里面店铺的ID
-    'countyStoreDecRoleId' => '810916A06B304162902408A6B9E5D177', // 报单中心里面区级店的ID
-    'daysDiff' => 0,
-    'userStatus' => [
-        0 => [
-            'value' => '0',
-            'label' => '未激活',
-        ],
-        1 => [
-            'value' => '1',
-            'label' => '正常',
-        ],
-        2 => [
-            'value' => '2',
-            'label' => '注销',
-        ],
-        3 => [
-            'value' => '3',
-            'label' => '黑名单',
-        ],
-        4 => [
-            'value' => '4',
-            'label' => '停发',
-        ],
-        9 => [
-            'value' => '9',
-            'label' => '永久关停',
-        ],
-    ],
-    'bonusWalletType' => [
-        'bonus' => [
-            'name' => 'bonus',
-            'label' => '会员账户奖金',
-        ],
-        'reconsume_points' => [
-            'name' => 'bonus',
-            'label' => '复消积分余额',
-        ],
-        'cash' => [
-            'name' => 'cash',
-            'label' => '会员账户余额',
-        ],
-        'exchange_points' => [
-            'name' => 'bonus',
-            'label' => '兑换积分余额',
-        ]
-//        'cf' => [
-//            'name' => 'cf',
-//            'label' => '车房养老奖余额',
-//        ],
-//        'lx' => [
-//            'name' => 'lx',
-//            'label' => '领袖分红奖余额',
-//        ],
-    ],
-    'auditStatus' => [
-        'un' => [
-            'value' => 0,
-            'label' => '未审核'
-        ],
-        'true' => [
-            'value' => 1,
-            'label' => '已审核'
-        ],
-        'false' => [
-            'value' => 2,
-            'label' => '审核失败'
-        ],
-        'reject' => [
-            'value' => 3,
-            'label' => '已拒绝'
-        ],
-    ],
-    // 发货状态
-    'deliveryStatus' => [
-        '0' => [
-            'value' => 0,
-            'label' => '未发货'
-        ],
-        'notDelivery' => [
-            'value' => 0,
-            'label' => '未发货'
-        ],
-        '1' => [
-            'value' => 1,
-            'label' => '已发货'
-        ],
-        'delivered' => [
-            'value' => 1,
-            'label' => '已发货'
-        ],
-        '2' => [
-            'value' => 2,
-            'label' => '确认收货'
-        ],
-        'confirm' => [
-            'value' => 2,
-            'label' => '确认收货'
-        ],
-    ],
-    'orderStatus' => [
-        '0' => [
-            'value' => 0,
-            'label' => '待支付'
-        ],
-        'notPaid' => [
-            'value' => 0,
-            'label' => '待支付'
-        ],
-        '1' => [
-            'value' => 1,
-            'label' => '已支付'
-        ],
-        'paid' => [
-            'value' => 1,
-            'label' => '已支付'
-        ],
-        // 此时进入发货流程参考发货状态
-        '3' => [
-            'value' => 3,
-            'label' => '物流状态'
-        ],
-        'delivery' => [
-            'value' => 3,
-            'label' => '物流状态'
-        ],
-        '4' => [
-            'value' => 4,
-            'label' => '订单完成'
-        ],
-        'complete' => [
-            'value' => 4,
-            'label' => '订单完成'
-        ],
-        '5' => [
-            'value' => 5,
-            'label' => '订单取消'
-        ],
-        'cancel' => [
-            'value' => 5,
-            'label' => '订单取消'
-        ],
-        '6' => [
-            'value' => 6,
-            'label' => '订单删除'
-        ],
-        'del' => [
-            'value' => 6,
-            'label' => '订单删除'
-        ],
-    ],
-    'exportModule' => [
-        'shop' => ['label' => '商城管理', 'value'=>'shop'],
-        'user' => ['label' => '会员管理', 'value'=>'user'],
-        'atlas' => ['label' => '网络图谱', 'value'=>'atlas'],
-        'reconsume' => ['label' => '复销管理', 'value'=>'reconsume'],
-        'bonus' => ['label' => '奖金管理', 'value'=>'bonus'],
-        //'report' => ['label' => '报表管理', 'value'=>'report'],
-        'finance' => ['label' => '财务管理', 'value'=>'finance'],
-        //'log' => ['label' => '日志管理', 'value'=>'log'],
-    ],
-    'snowFake' => [
-        'dataCenterId' => 1,//
-        'workerId' => 1,
-    ],
-    'pageSnowFake' => [
-        'dataCenterId' => 2,//
-        'workerId' => 2,
-    ],
-];
+<?php
+$nationParams = require_once __DIR__ . '/params-nation.php';
+return [
+    'adminEmail' => 'admin@example.com',
+    'supportEmail' => 'support@example.com',
+    'nation' => $nationParams,
+    'backAccessTokenExpiresIn' => 3000 * 60,
+    'backRefreshTokenExpiresIn' => 3000 * 60 * 60,
+    'frontAccessTokenExpiresIn' => 3000 * 60,
+    'frontRefreshTokenExpiresIn' => 3000 * 60 * 60,
+    'user.passwordResetTokenExpire' => 3600,
+    'operationTimeOut' => 15 * 60,     // 这里设置的15分钟超时
+    'pageSize' => 20,
+    'http' => [
+        'shopApi' => [
+            'authKey' => 'sErypUtORfuloNdiTYLINArdtHErSAnDkiRPRElTaiNgIneUSEardopEnTAcErNO',
+            'timeDiff' => 0,
+        ],
+        'remoteUploadApi' => [
+            'authKey' => 'k4Ao7KWVbvg3Z2L6KLwN9OoDjQL5SioJffIPoODATxCynuEVEAt0278kg7r9FHiS',
+            'host' => $mainConfig['remoteUploadHost'],
+            'remoteUploadNotifyUrl' => '',
+        ],
+        'backendToFrontendApi' => [
+            'authKey' => 'hYkDsjhj6CfGMKbRMjoKtMauMEHiufyikGmziqy2anXYTMXhsUkrPC6YbvyHmdLD',
+            'timeDiff' => 0,
+        ],
+        'lingYunGongApi' => [
+            'host' => $mainConfig['idCardVerify']['host'],
+            'authToken' => [
+                'path' => '/uaa/v1/auth/tokens',
+                'clientId' => $mainConfig['idCardVerify']['clientId'],
+            ],
+            'hasIdCardInfoPath' => '/socialwork/v1/external/freedom-emps/has-idcard-info/%s',
+        ]
+//        'requestShop' => [
+//            'url' => $mainConfig['requestShopUrl'],
+//            'username' => 'bonus_api',
+//            'password' => 'bonus_api',
+//        ]
+
+    ],
+    'shopWalletType' => [
+        'cash' =>[
+            'value'=>'cash',
+            'title'=>'现金钱包',
+        ],
+    ],
+    'shopFlowType' => [
+        'remit' => [
+            'value' => 'remit',
+            'label' => '汇款充值',
+        ],
+        'recharge' => [
+            'value' => 'recharge',
+            'label' => '第三方充值',
+        ],
+        'transfer_out' => [
+            'value' => 'transfer_out',
+            'label' => '转出',
+        ],
+        'transfer_in' => [
+            'value' => 'transfer_in',
+            'label' => '转入',
+        ],
+        'pay' => [
+            'value' => 'pay',
+            'label' => '支付',
+        ],
+        'decRecharge' => [
+            'value' => 'decRecharge',
+            'label' => '报单充入',
+        ],
+        'orderRecharge' => [
+            'value' => 'orderRecharge',
+            'label' => '订货充入',
+        ],
+        'freight' => [
+            'value' => 'freight',
+            'label' => '支付运费',
+        ],
+        'adjust_recharge' => [
+            'value' => 'adjust_recharge',
+            'label' => '待调整充入',
+        ],
+        'adjust_deduct' => [
+            'value' => 'adjust_deduct',
+            'label' => '待调整扣除',
+        ],
+        'adjust_transfer_out' => [
+            'value' => 'adjust_transfer_out',
+            'label' => '待调整转出',
+        ],
+        'adjust_transfer_in' => [
+            'value' => 'adjust_transfer_in',
+            'label' => '待调整转入',
+        ],
+        'exchange_recharge' => [
+            'value' => 'exchange_recharge',
+            'label' => '换货充入',
+        ],
+        'exchange_deduct' => [
+            'value' => 'exchange_deduct',
+            'label' => '换货扣除',
+        ],
+        'delete_order_deduct' => [
+            'value' => 'delete_order_deduct',
+            'label' => '删单自动扣除',
+        ],
+        'delete_order_recharge' => [
+            'value' => 'delete_order_recharge',
+            'label' => '删单自动充入',
+        ],
+        'delete_order_return' => [
+            'value' => 'delete_order_return',
+            'label' => '删单扣回',
+        ],
+        'repair_pay' => [
+            'value' => 'repair_pay',
+            'label' => '支付维修费',
+        ],
+        'after_sale_exchange_recharge' => [
+            'value' => 'after_sale_exchange_recharge',
+            'label' => '售后调货充入',
+        ],
+        'after_sale_exchange_deduct' => [
+            'value' => 'after_sale_exchange_deduct',
+            'label' => '售后调货扣费',
+        ],
+        'oms_deduct' => [
+            'value' => 'oms_deduct',
+            'label' => 'OMS扣款',
+        ],
+        'deduct' => [
+            'value' => 'deduct',
+            'label' => '扣除',
+        ],
+        'incr' => [
+            'value' => 'incr',
+            'label' => '增加',
+        ],
+        'other' => [
+            'value' => 'other',
+            'label' => '其它',
+        ],
+        'handle' => [
+            'value' => 'handle',
+            'label' => '管理员手动调整',
+        ],
+    ],
+    'enableLog' => true,
+    'isRemoteUpload' => false, // 是否上传至远程
+    'excelLocalDir' => 'excel_export', // 是否上传至远程
+    'superAdminRoleId' => '666A7F102B8D6C66E055736AECE8644D',
+    'mainAdminId' => '65F27BCE7FD278FFE055736AECE8644D',
+    'mainUserId' => '670B84FD7C216D4EE055736AECE8644D',
+    'hbCouponsProId' => '1000000000', // 货补优惠券
+    'storeDecRoleId' => '8976C62F40064D8AB357BE07C8A3CA8F', // 报单中心里面店铺的ID
+    'countyStoreDecRoleId' => '810916A06B304162902408A6B9E5D177', // 报单中心里面区级店的ID
+    'daysDiff' => 0,
+    'userStatus' => [
+        0 => [
+            'value' => '0',
+            'label' => '未激活',
+        ],
+        1 => [
+            'value' => '1',
+            'label' => '正常',
+        ],
+        2 => [
+            'value' => '2',
+            'label' => '注销',
+        ],
+        3 => [
+            'value' => '3',
+            'label' => '黑名单',
+        ],
+        4 => [
+            'value' => '4',
+            'label' => '停发',
+        ],
+        9 => [
+            'value' => '9',
+            'label' => '永久关停',
+        ],
+    ],
+    'bonusWalletType' => [
+        'bonus' => [
+            'name' => 'bonus',
+            'label' => '会员账户奖金',
+        ],
+        'reconsume_points' => [
+            'name' => 'bonus',
+            'label' => '复消积分余额',
+        ],
+        'cash' => [
+            'name' => 'cash',
+            'label' => '会员账户余额',
+        ],
+        'exchange_points' => [
+            'name' => 'bonus',
+            'label' => '兑换点数余额',
+        ]
+//        'cf' => [
+//            'name' => 'cf',
+//            'label' => '车房养老奖余额',
+//        ],
+//        'lx' => [
+//            'name' => 'lx',
+//            'label' => '领袖分红奖余额',
+//        ],
+    ],
+    'auditStatus' => [
+        'un' => [
+            'value' => 0,
+            'label' => '未审核'
+        ],
+        'true' => [
+            'value' => 1,
+            'label' => '已审核'
+        ],
+        'false' => [
+            'value' => 2,
+            'label' => '审核失败'
+        ],
+        'reject' => [
+            'value' => 3,
+            'label' => '已拒绝'
+        ],
+    ],
+    // 发货状态
+    'deliveryStatus' => [
+        '0' => [
+            'value' => 0,
+            'label' => '未发货'
+        ],
+        'notDelivery' => [
+            'value' => 0,
+            'label' => '未发货'
+        ],
+        '1' => [
+            'value' => 1,
+            'label' => '已发货'
+        ],
+        'delivered' => [
+            'value' => 1,
+            'label' => '已发货'
+        ],
+        '2' => [
+            'value' => 2,
+            'label' => '确认收货'
+        ],
+        'confirm' => [
+            'value' => 2,
+            'label' => '确认收货'
+        ],
+    ],
+    'orderStatus' => [
+        '0' => [
+            'value' => 0,
+            'label' => '待支付'
+        ],
+        'notPaid' => [
+            'value' => 0,
+            'label' => '待支付'
+        ],
+        '1' => [
+            'value' => 1,
+            'label' => '已支付'
+        ],
+        'paid' => [
+            'value' => 1,
+            'label' => '已支付'
+        ],
+        // 此时进入发货流程参考发货状态
+        '3' => [
+            'value' => 3,
+            'label' => '物流状态'
+        ],
+        'delivery' => [
+            'value' => 3,
+            'label' => '物流状态'
+        ],
+        '4' => [
+            'value' => 4,
+            'label' => '订单完成'
+        ],
+        'complete' => [
+            'value' => 4,
+            'label' => '订单完成'
+        ],
+        '5' => [
+            'value' => 5,
+            'label' => '订单取消'
+        ],
+        'cancel' => [
+            'value' => 5,
+            'label' => '订单取消'
+        ],
+        '6' => [
+            'value' => 6,
+            'label' => '订单删除'
+        ],
+        'del' => [
+            'value' => 6,
+            'label' => '订单删除'
+        ],
+    ],
+    'exportModule' => [
+        'shop' => ['label' => '商城管理', 'value'=>'shop'],
+        'user' => ['label' => '会员管理', 'value'=>'user'],
+        'atlas' => ['label' => '网络图谱', 'value'=>'atlas'],
+        'reconsume' => ['label' => '复销管理', 'value'=>'reconsume'],
+        'bonus' => ['label' => '奖金管理', 'value'=>'bonus'],
+        //'report' => ['label' => '报表管理', 'value'=>'report'],
+        'finance' => ['label' => '财务管理', 'value'=>'finance'],
+        //'log' => ['label' => '日志管理', 'value'=>'log'],
+    ],
+    'snowFake' => [
+        'dataCenterId' => 1,//
+        'workerId' => 1,
+    ],
+    'pageSnowFake' => [
+        'dataCenterId' => 2,//
+        'workerId' => 2,
+    ],
+];

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

+ 101 - 1
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

+ 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,

+ 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' => '分区日期',
+        ];
+    }
+}

+ 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 - 1
common/models/Transfer.php

@@ -37,7 +37,7 @@ class Transfer extends \common\components\ActiveRecord
     const WALLET_NAME = [
         'bonus'=>'奖金',
         'cash'=>'余额',
-        'point'=>'复消积分',
+        '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;
+    }
+}

+ 549 - 549
console/controllers/BonusController.php

@@ -1,550 +1,550 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: leo
- * Date: 2018/3/9
- * Time: 上午11:56
- */
-namespace console\controllers;
-
-use backendApi\modules\v1\models\lists\bonus\BalanceList;
-use backendApi\modules\v1\models\lists\bonus\CfLxAuditList;
-use backendApi\modules\v1\models\lists\bonus\FlowBalanceList;
-use backendApi\modules\v1\models\lists\bonus\FlowBonusList;
-use backendApi\modules\v1\models\lists\bonus\FlowCfList;
-use backendApi\modules\v1\models\lists\bonus\FlowExchangePointsList;
-use backendApi\modules\v1\models\lists\bonus\FlowLxList;
-use backendApi\modules\v1\models\lists\bonus\FlowReconsumePointsList;
-use backendApi\modules\v1\models\lists\bonus\OtherPeriodBonusList;
-use backendApi\modules\v1\models\lists\bonus\PerfMonthList;
-use backendApi\modules\v1\models\lists\bonus\PerfOrderList;
-use backendApi\modules\v1\models\lists\bonus\PerfPeriodList;
-use backendApi\modules\v1\models\lists\bonus\PerfStandardList;
-use backendApi\modules\v1\models\lists\bonus\PeriodBonusList;
-use backendApi\modules\v1\models\lists\bonus\ResendQyAuditList;
-use backendApi\modules\v1\models\lists\bonus\ResendQyList;
-use backendApi\modules\v1\models\lists\bonus\ScoreMonthList;
-use backendApi\modules\v1\models\lists\bonus\TraceBtList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownBdList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownFxList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownGlList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownGxList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownQyList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownTgList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownXfList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownYcList;
-use backendApi\modules\v1\models\lists\bonus\TraceDownYjList;
-use backendApi\modules\v1\models\lists\bonus\TraceFlList;
-use backendApi\modules\v1\models\lists\bonus\TraceFwList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpBdList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpFxList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpGlList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpGxList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpQyList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpTgList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpXfList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpYcList;
-use backendApi\modules\v1\models\lists\bonus\TraceUpYjList;
-use backendApi\modules\v1\models\lists\bonus\UserPerfList;
-use common\helpers\Cache;
-use common\helpers\Excel;
-use common\helpers\Form;
-use common\helpers\http\RemoteUploadApi;
-use common\helpers\Log;
-use common\libs\export\module\BonusExport;
-use common\models\forms\PeriodForm;
-use common\models\LogAsync;
-use common\models\Withdraw;
-use yii\db\Exception;
-
-class BonusController extends BaseController
-{
-
-    /**
-     * 生成业绩单并计算业绩
-     * @param $taskKey
-     * @throws Exception
-     * @throws \yii\base\Exception
-     */
-    public function actionPerf($taskKey){
-        $params = Cache::getAsyncParams($taskKey);
-        $formModel = new PeriodForm();
-        $handleResult = false;
-        if($formModel->load($params, '') && $formModel->perfAsync($params['handleUserId'])){
-            $handleResult = true;
-            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期生成业绩单更新成功");
-        } else {
-            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期生成业绩单更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors()), false);
-        }
-        if(!$handleResult){
-            echo "第{$params['periodNum']}期生成业绩单更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors());
-            // Log::async([
-//                'type' => LogAsync::TYPE_BONUS,
-//                'route' => \Yii::$app->controller->id.'/'.\Yii::$app->controller->action->id,
-//                'title' => "第{$params['periodNum']}期生成业绩单更新失败",
-//                'detail' => "第{$params['periodNum']}期生成业绩单更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors()),
-//                'status' => 0,
-//            ]);
-        }
-    }
-
-    /**
-     * 结算奖金
-     * @param $taskKey
-     * @throws Exception
-     * @throws \yii\base\Exception
-     */
-    public function actionCalc($taskKey){
-        $params = Cache::getAsyncParams($taskKey);
-        $formModel = new PeriodForm();
-        $handleResult = false;
-        if($formModel->load($params, '') && $formModel->calcAsync($params['handleUserId'])){
-            $handleResult = true;
-            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期奖金结算更新成功");
-        } else {
-            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期奖金结算更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors()), false);
-        }
-        if(!$handleResult){
-            echo "第{$params['periodNum']}期奖金结算更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors());
-            // Log::async([
-//                'type' => LogAsync::TYPE_BONUS,
-//                'route' => \Yii::$app->controller->id.'/'.\Yii::$app->controller->action->id,
-//                'title' => "第{$params['periodNum']}期奖金结算更新失败",
-//                'detail' => "第{$params['periodNum']}期奖金结算更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors()),
-//                'status' => 0,
-//            ]);
-        }
-    }
-
-    /**
-     * 奖金挂网
-     * @param $taskKey
-     * @throws Exception
-     * @throws \yii\base\Exception
-     */
-    public function actionSend($taskKey){
-        $params = Cache::getAsyncParams($taskKey);
-        $formModel = new PeriodForm();
-        $handleResult = false;
-        if($formModel->load($params, '') && $formModel->sendAsync($params['handleUserId'])){
-            $handleResult = true;
-            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期挂网成功");
-        } else {
-            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期挂网失败,原因:".Form::formatErrorsForApi($formModel->getErrors()), false);
-        }
-        if(!$handleResult){
-            echo "第{$params['periodNum']}期挂网失败,原因:".Form::formatErrorsForApi($formModel->getErrors());
-            // Log::async([
-//                'type' => LogAsync::TYPE_BONUS,
-//                'route' => \Yii::$app->controller->id.'/'.\Yii::$app->controller->action->id,
-//                'title' => "第{$params['periodNum']}期挂网失败",
-//                'detail' => "第{$params['periodNum']}期挂网失败,原因:".Form::formatErrorsForApi($formModel->getErrors()),
-//                'status' => 0,
-//            ]);
-        }
-    }
-
-    /**
-     * 后台手动封期时调用的封期后操作
-     * @param $taskKey
-     * @throws Exception
-     */
-    public function actionAfterClose($taskKey){
-        $params = Cache::getAsyncParams($taskKey);
-        $formModel = new PeriodForm();
-        $handleResult = false;
-        if($formModel->afterCloseAsync($params['periodNum'], $params['closedAt'])){
-            $handleResult = true;
-        }
-        if(!$handleResult){
-            // Log::async([
-//                'type' => LogAsync::TYPE_BONUS,
-//                'route' => \Yii::$app->controller->id.'/'.\Yii::$app->controller->action->id,
-//                'title' => "于{$params['periodNum']}期自动提现上月奖金失败",
-//                'detail' => "于{$params['periodNum']}期自动提现上月奖金失败",
-//                'status' => 0,
-//            ]);
-        }
-    }
-
-    /**
-     * 奖金余额导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionBalanceExport($taskId){
-        return $this->_export($taskId, BalanceList::class, '会员奖金余额列表');
-    }
-
-    /**
-     * 车房养老奖和领袖分红年度发放审核导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionCfLxAuditExport($taskId){
-        return $this->_export($taskId, CfLxAuditList::class, '年度奖金发放审核列表');
-    }
-
-    /**
-     * 最新奖金列表导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionNewPeriodBonusExport($taskId){
-        return $this->_export($taskId, PeriodBonusList::class, '最新奖金列表');
-    }
-
-    /**
-     * 往期奖金列表导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionOtherPeriodBonusExport($taskId){
-        return $this->_export($taskId, PeriodBonusList::class, '往期奖金列表');
-    }
-
-    /**
-     * 奖金流水列表导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionFlowBonusExport($taskId){
-        return $this->_export($taskId, FlowBonusList::class, '奖金流水列表');
-    }
-
-    /**
-     * 余额流水导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionFlowBalanceExport($taskId){
-        return $this->_export($taskId, FlowBalanceList::class, '复消积分流水列表');
-    }
-
-    /**
-     * 复消积分流水导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionFlowRpExport($taskId){
-        return $this->_export($taskId, FlowReconsumePointsList::class, '复消积分流水列表');
-    }
-
-    /**
-     * 兑换积分流水导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionFlowExchangeExport($taskId){
-        return $this->_export($taskId, FlowExchangePointsList::class, '兑换积分流水列表');
-    }
-
-    /**
-     * 车房养老奖流水导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionFlowCfExport($taskId){
-        return $this->_export($taskId, FlowCfList::class, '车房养老奖流水列表');
-    }
-
-    /**
-     * 领袖分红奖导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionFlowLxExport($taskId){
-        return $this->_export($taskId, FlowLxList::class, '领袖分红奖流水列表');
-    }
-
-    /**
-     * 区域津贴补发列表
-     * @param $taskId
-     * @return bool
-     */
-    public function actionResendQyListExport($taskId){
-        return $this->_export($taskId, ResendQyList::class, '区域津贴补发列表');
-    }
-
-    /**
-     * 补发区域津贴审核列表
-     * @param $taskId
-     * @return bool
-     */
-    public function actionResendQyAuditListExport($taskId){
-        return $this->_export($taskId, ResendQyAuditList::class, '补发区域津贴审核列表');
-    }
-
-    /**
-     * 团队奖向下追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceDownQyExport($taskId){
-        return $this->_export($taskId, TraceDownQyList::class, '团队奖向下追溯导出列表');
-    }
-
-    /**
-     * 团队奖向上追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceUpQyExport($taskId){
-        return $this->_export($taskId, TraceUpQyList::class, '团队奖向上追溯导出列表');
-    }
-
-    /**
-     * 荣衔奖向下追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceDownYcExport($taskId){
-        return $this->_export($taskId, TraceDownYcList::class, '荣衔奖向下追溯导出列表');
-    }
-
-    /**
-     * 荣衔奖向上追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceUpYcExport($taskId){
-        return $this->_export($taskId, TraceUpYcList::class, '荣衔奖向上追溯导出列表');
-    }
-
-    /**
-     * 服务奖向下追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceDownBdExport($taskId){
-        return $this->_export($taskId, TraceDownYcList::class, '服务奖向下追溯导出列表');
-    }
-
-    /**
-     * 服务奖向上追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceUpBdExport($taskId){
-        return $this->_export($taskId, TraceUpYcList::class, '服务奖向上追溯导出列表');
-    }
-
-    /**
-     * 推广奖向下追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceDownTgExport($taskId){
-        return $this->_export($taskId, TraceDownTgList::class, '推广奖向下追溯导出列表');
-    }
-
-
-    /**
-     * 推广奖向上追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceUpTgExport($taskId){
-        return $this->_export($taskId, TraceUpTgList::class, '推广奖向上追溯导出列表');
-    }
-
-
-    /**
-     * 消费奖向下追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceDownXfExport($taskId){
-        return $this->_export($taskId, TraceDownXfList::class, '消费奖向下追溯导出列表');
-    }
-
-
-    /**
-     * 消费奖向上追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceUpXfExport($taskId){
-        return $this->_export($taskId, TraceUpXfList::class, '消费奖向上追溯导出列表');
-    }
-
-
-    /**
-     * 业绩奖向下追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceDownYjExport($taskId){
-        return $this->_export($taskId, TraceDownYjList::class, '业绩奖向下追溯导出列表');
-    }
-
-    /**
-     * 业绩奖向上追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceUpYjExport($taskId){
-        return $this->_export($taskId, TraceUpYjList::class, '业绩奖向上追溯导出列表');
-    }
-
-    /**
-     * 管理奖向下追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceDownGlExport($taskId){
-        return $this->_export($taskId, TraceDownGlList::class, '管理奖向下追溯导出列表');
-    }
-
-    /**
-     * 管理奖向上追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceUpGlExport($taskId){
-        return $this->_export($taskId, TraceUpGlList::class, '管理奖向上追溯导出列表');
-    }
-
-
-    /**
-     * 共享奖向下追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceDownGxExport($taskId){
-        return $this->_export($taskId, TraceDownGxList::class, '共享奖向下追溯导出列表');
-    }
-
-    /**
-     * 共享奖向上追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceUpBdGxport($taskId){
-        return $this->_export($taskId, TraceUpGxList::class, '共享奖向上追溯导出列表');
-    }
-
-
-    /**
-     * 复销奖向下追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceDownFxExport($taskId){
-        return $this->_export($taskId, TraceDownFxList::class, '复销奖向下追溯导出列表');
-    }
-
-    /**
-     * 复销奖向上追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceUpFxExport($taskId){
-        return $this->_export($taskId, TraceUpFxList::class, '复销奖向上追溯导出列表');
-    }
-
-    /**
-     * 报单中心补贴追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceBtExport($taskId){
-        return $this->_export($taskId, TraceBtList::class, '报单中心补贴追溯列表');
-    }
-
-    /**
-     * 报单中心货补追溯导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceFlExport($taskId){
-        return $this->_export($taskId, TraceFlList::class, '报单中心货补追溯列表');
-    }
-
-    /**
-     * 区域业绩提成追溯列表导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionTraceFwExport($taskId){
-        return $this->_export($taskId, TraceFwList::class, '区域业绩提成追溯列表');
-    }
-
-    /**
-     * 业绩单导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionPerfOrderExport($taskId){
-        return $this->_export($taskId, PerfOrderList::class, '业绩单列表');
-    }
-
-    /**
-     * 月积分导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionScoreMonthExport($taskId){
-        return $this->_export($taskId, ScoreMonthList::class, '月积分列表');
-    }
-
-    /**
-     * 月业绩导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionPerfMonthExport($taskId){
-        return $this->_export($taskId, PerfMonthList::class, '月业绩列表');
-    }
-
-    /**
-     * 达标业绩导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionPerfStandardExport($taskId){
-        return $this->_export($taskId, PerfStandardList::class, '达标业绩列表');
-    }
-
-    /**
-     * 月业绩导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionUserPerfExport($taskId){
-        return $this->_export($taskId, UserPerfList::class, '用户业绩列表');
-    }
-
-    /**
-     * 期业绩导出
-     * @param $taskId
-     * @return bool
-     */
-    public function actionPerfPeriodListExport($taskId){
-        return $this->_export($taskId, PerfPeriodList::class, '期业绩列表');
-    }
-
-    /**
-     * 导出方法
-     * @param $taskId
-     * @param $className
-     * @param $listName
-     * @return bool
-     */
-    private function _export($taskId, $className, $listName){
-        $factory = BonusExport::factory($taskId);
-        $factory->listModelClass = $className;
-        try {
-            if ($factory->generate()) {
-                \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($factory->getUserId(), $listName.'导出成功');
-            }
-            unset($factory, $taskId, $className, $listName);
-            return true;
-        } catch (\Exception $e) {
-            echo $listName.'导出失败。详情:' . $e->getMessage();
-            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($factory->getUserId(), $listName.'导出失败。详情:' . $e->getMessage(), false);
-        }
-        unset($factory, $taskId, $className, $listName);
-        return false;
-    }
+<?php
+/**
+ * Created by PhpStorm.
+ * User: leo
+ * Date: 2018/3/9
+ * Time: 上午11:56
+ */
+namespace console\controllers;
+
+use backendApi\modules\v1\models\lists\bonus\BalanceList;
+use backendApi\modules\v1\models\lists\bonus\CfLxAuditList;
+use backendApi\modules\v1\models\lists\bonus\FlowBalanceList;
+use backendApi\modules\v1\models\lists\bonus\FlowBonusList;
+use backendApi\modules\v1\models\lists\bonus\FlowCfList;
+use backendApi\modules\v1\models\lists\bonus\FlowExchangePointsList;
+use backendApi\modules\v1\models\lists\bonus\FlowLxList;
+use backendApi\modules\v1\models\lists\bonus\FlowReconsumePointsList;
+use backendApi\modules\v1\models\lists\bonus\OtherPeriodBonusList;
+use backendApi\modules\v1\models\lists\bonus\PerfMonthList;
+use backendApi\modules\v1\models\lists\bonus\PerfOrderList;
+use backendApi\modules\v1\models\lists\bonus\PerfPeriodList;
+use backendApi\modules\v1\models\lists\bonus\PerfStandardList;
+use backendApi\modules\v1\models\lists\bonus\PeriodBonusList;
+use backendApi\modules\v1\models\lists\bonus\ResendQyAuditList;
+use backendApi\modules\v1\models\lists\bonus\ResendQyList;
+use backendApi\modules\v1\models\lists\bonus\ScoreMonthList;
+use backendApi\modules\v1\models\lists\bonus\TraceBtList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownBdList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownFxList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownGlList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownGxList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownQyList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownTgList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownXfList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownYcList;
+use backendApi\modules\v1\models\lists\bonus\TraceDownYjList;
+use backendApi\modules\v1\models\lists\bonus\TraceFlList;
+use backendApi\modules\v1\models\lists\bonus\TraceFwList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpBdList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpFxList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpGlList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpGxList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpQyList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpTgList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpXfList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpYcList;
+use backendApi\modules\v1\models\lists\bonus\TraceUpYjList;
+use backendApi\modules\v1\models\lists\bonus\UserPerfList;
+use common\helpers\Cache;
+use common\helpers\Excel;
+use common\helpers\Form;
+use common\helpers\http\RemoteUploadApi;
+use common\helpers\Log;
+use common\libs\export\module\BonusExport;
+use common\models\forms\PeriodForm;
+use common\models\LogAsync;
+use common\models\Withdraw;
+use yii\db\Exception;
+
+class BonusController extends BaseController
+{
+
+    /**
+     * 生成业绩单并计算业绩
+     * @param $taskKey
+     * @throws Exception
+     * @throws \yii\base\Exception
+     */
+    public function actionPerf($taskKey){
+        $params = Cache::getAsyncParams($taskKey);
+        $formModel = new PeriodForm();
+        $handleResult = false;
+        if($formModel->load($params, '') && $formModel->perfAsync($params['handleUserId'])){
+            $handleResult = true;
+            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期生成业绩单更新成功");
+        } else {
+            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期生成业绩单更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors()), false);
+        }
+        if(!$handleResult){
+            echo "第{$params['periodNum']}期生成业绩单更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors());
+            // Log::async([
+//                'type' => LogAsync::TYPE_BONUS,
+//                'route' => \Yii::$app->controller->id.'/'.\Yii::$app->controller->action->id,
+//                'title' => "第{$params['periodNum']}期生成业绩单更新失败",
+//                'detail' => "第{$params['periodNum']}期生成业绩单更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors()),
+//                'status' => 0,
+//            ]);
+        }
+    }
+
+    /**
+     * 结算奖金
+     * @param $taskKey
+     * @throws Exception
+     * @throws \yii\base\Exception
+     */
+    public function actionCalc($taskKey){
+        $params = Cache::getAsyncParams($taskKey);
+        $formModel = new PeriodForm();
+        $handleResult = false;
+        if($formModel->load($params, '') && $formModel->calcAsync($params['handleUserId'])){
+            $handleResult = true;
+            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期奖金结算更新成功");
+        } else {
+            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期奖金结算更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors()), false);
+        }
+        if(!$handleResult){
+            echo "第{$params['periodNum']}期奖金结算更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors());
+            // Log::async([
+//                'type' => LogAsync::TYPE_BONUS,
+//                'route' => \Yii::$app->controller->id.'/'.\Yii::$app->controller->action->id,
+//                'title' => "第{$params['periodNum']}期奖金结算更新失败",
+//                'detail' => "第{$params['periodNum']}期奖金结算更新失败,原因:".Form::formatErrorsForApi($formModel->getErrors()),
+//                'status' => 0,
+//            ]);
+        }
+    }
+
+    /**
+     * 奖金挂网
+     * @param $taskKey
+     * @throws Exception
+     * @throws \yii\base\Exception
+     */
+    public function actionSend($taskKey){
+        $params = Cache::getAsyncParams($taskKey);
+        $formModel = new PeriodForm();
+        $handleResult = false;
+        if($formModel->load($params, '') && $formModel->sendAsync($params['handleUserId'])){
+            $handleResult = true;
+            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期挂网成功");
+        } else {
+            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($params['handleUserId'], "第{$params['periodNum']}期挂网失败,原因:".Form::formatErrorsForApi($formModel->getErrors()), false);
+        }
+        if(!$handleResult){
+            echo "第{$params['periodNum']}期挂网失败,原因:".Form::formatErrorsForApi($formModel->getErrors());
+            // Log::async([
+//                'type' => LogAsync::TYPE_BONUS,
+//                'route' => \Yii::$app->controller->id.'/'.\Yii::$app->controller->action->id,
+//                'title' => "第{$params['periodNum']}期挂网失败",
+//                'detail' => "第{$params['periodNum']}期挂网失败,原因:".Form::formatErrorsForApi($formModel->getErrors()),
+//                'status' => 0,
+//            ]);
+        }
+    }
+
+    /**
+     * 后台手动封期时调用的封期后操作
+     * @param $taskKey
+     * @throws Exception
+     */
+    public function actionAfterClose($taskKey){
+        $params = Cache::getAsyncParams($taskKey);
+        $formModel = new PeriodForm();
+        $handleResult = false;
+        if($formModel->afterCloseAsync($params['periodNum'], $params['closedAt'])){
+            $handleResult = true;
+        }
+        if(!$handleResult){
+            // Log::async([
+//                'type' => LogAsync::TYPE_BONUS,
+//                'route' => \Yii::$app->controller->id.'/'.\Yii::$app->controller->action->id,
+//                'title' => "于{$params['periodNum']}期自动提现上月奖金失败",
+//                'detail' => "于{$params['periodNum']}期自动提现上月奖金失败",
+//                'status' => 0,
+//            ]);
+        }
+    }
+
+    /**
+     * 奖金余额导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionBalanceExport($taskId){
+        return $this->_export($taskId, BalanceList::class, '会员奖金余额列表');
+    }
+
+    /**
+     * 车房养老奖和领袖分红年度发放审核导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionCfLxAuditExport($taskId){
+        return $this->_export($taskId, CfLxAuditList::class, '年度奖金发放审核列表');
+    }
+
+    /**
+     * 最新奖金列表导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionNewPeriodBonusExport($taskId){
+        return $this->_export($taskId, PeriodBonusList::class, '最新奖金列表');
+    }
+
+    /**
+     * 往期奖金列表导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionOtherPeriodBonusExport($taskId){
+        return $this->_export($taskId, PeriodBonusList::class, '往期奖金列表');
+    }
+
+    /**
+     * 奖金流水列表导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionFlowBonusExport($taskId){
+        return $this->_export($taskId, FlowBonusList::class, '奖金流水列表');
+    }
+
+    /**
+     * 余额流水导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionFlowBalanceExport($taskId){
+        return $this->_export($taskId, FlowBalanceList::class, '复消积分流水列表');
+    }
+
+    /**
+     * 复消积分流水导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionFlowRpExport($taskId){
+        return $this->_export($taskId, FlowReconsumePointsList::class, '复消积分流水列表');
+    }
+
+    /**
+     * 兑换积分流水导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionFlowExchangeExport($taskId){
+        return $this->_export($taskId, FlowExchangePointsList::class, '兑换点数流水列表');
+    }
+
+    /**
+     * 车房养老奖流水导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionFlowCfExport($taskId){
+        return $this->_export($taskId, FlowCfList::class, '车房养老奖流水列表');
+    }
+
+    /**
+     * 领袖分红奖导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionFlowLxExport($taskId){
+        return $this->_export($taskId, FlowLxList::class, '领袖分红奖流水列表');
+    }
+
+    /**
+     * 区域津贴补发列表
+     * @param $taskId
+     * @return bool
+     */
+    public function actionResendQyListExport($taskId){
+        return $this->_export($taskId, ResendQyList::class, '区域津贴补发列表');
+    }
+
+    /**
+     * 补发区域津贴审核列表
+     * @param $taskId
+     * @return bool
+     */
+    public function actionResendQyAuditListExport($taskId){
+        return $this->_export($taskId, ResendQyAuditList::class, '补发区域津贴审核列表');
+    }
+
+    /**
+     * 团队奖向下追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceDownQyExport($taskId){
+        return $this->_export($taskId, TraceDownQyList::class, '团队奖向下追溯导出列表');
+    }
+
+    /**
+     * 团队奖向上追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceUpQyExport($taskId){
+        return $this->_export($taskId, TraceUpQyList::class, '团队奖向上追溯导出列表');
+    }
+
+    /**
+     * 荣衔奖向下追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceDownYcExport($taskId){
+        return $this->_export($taskId, TraceDownYcList::class, '荣衔奖向下追溯导出列表');
+    }
+
+    /**
+     * 荣衔奖向上追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceUpYcExport($taskId){
+        return $this->_export($taskId, TraceUpYcList::class, '荣衔奖向上追溯导出列表');
+    }
+
+    /**
+     * 服务奖向下追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceDownBdExport($taskId){
+        return $this->_export($taskId, TraceDownYcList::class, '服务奖向下追溯导出列表');
+    }
+
+    /**
+     * 服务奖向上追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceUpBdExport($taskId){
+        return $this->_export($taskId, TraceUpYcList::class, '服务奖向上追溯导出列表');
+    }
+
+    /**
+     * 推广奖向下追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceDownTgExport($taskId){
+        return $this->_export($taskId, TraceDownTgList::class, '推广奖向下追溯导出列表');
+    }
+
+
+    /**
+     * 推广奖向上追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceUpTgExport($taskId){
+        return $this->_export($taskId, TraceUpTgList::class, '推广奖向上追溯导出列表');
+    }
+
+
+    /**
+     * 消费奖向下追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceDownXfExport($taskId){
+        return $this->_export($taskId, TraceDownXfList::class, '消费奖向下追溯导出列表');
+    }
+
+
+    /**
+     * 消费奖向上追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceUpXfExport($taskId){
+        return $this->_export($taskId, TraceUpXfList::class, '消费奖向上追溯导出列表');
+    }
+
+
+    /**
+     * 业绩奖向下追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceDownYjExport($taskId){
+        return $this->_export($taskId, TraceDownYjList::class, '业绩奖向下追溯导出列表');
+    }
+
+    /**
+     * 业绩奖向上追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceUpYjExport($taskId){
+        return $this->_export($taskId, TraceUpYjList::class, '业绩奖向上追溯导出列表');
+    }
+
+    /**
+     * 管理奖向下追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceDownGlExport($taskId){
+        return $this->_export($taskId, TraceDownGlList::class, '管理奖向下追溯导出列表');
+    }
+
+    /**
+     * 管理奖向上追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceUpGlExport($taskId){
+        return $this->_export($taskId, TraceUpGlList::class, '管理奖向上追溯导出列表');
+    }
+
+
+    /**
+     * 共享奖向下追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceDownGxExport($taskId){
+        return $this->_export($taskId, TraceDownGxList::class, '共享奖向下追溯导出列表');
+    }
+
+    /**
+     * 共享奖向上追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceUpBdGxport($taskId){
+        return $this->_export($taskId, TraceUpGxList::class, '共享奖向上追溯导出列表');
+    }
+
+
+    /**
+     * 复销奖向下追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceDownFxExport($taskId){
+        return $this->_export($taskId, TraceDownFxList::class, '复销奖向下追溯导出列表');
+    }
+
+    /**
+     * 复销奖向上追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceUpFxExport($taskId){
+        return $this->_export($taskId, TraceUpFxList::class, '复销奖向上追溯导出列表');
+    }
+
+    /**
+     * 报单中心补贴追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceBtExport($taskId){
+        return $this->_export($taskId, TraceBtList::class, '报单中心补贴追溯列表');
+    }
+
+    /**
+     * 报单中心货补追溯导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceFlExport($taskId){
+        return $this->_export($taskId, TraceFlList::class, '报单中心货补追溯列表');
+    }
+
+    /**
+     * 区域业绩提成追溯列表导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionTraceFwExport($taskId){
+        return $this->_export($taskId, TraceFwList::class, '区域业绩提成追溯列表');
+    }
+
+    /**
+     * 业绩单导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionPerfOrderExport($taskId){
+        return $this->_export($taskId, PerfOrderList::class, '业绩单列表');
+    }
+
+    /**
+     * 月积分导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionScoreMonthExport($taskId){
+        return $this->_export($taskId, ScoreMonthList::class, '月积分列表');
+    }
+
+    /**
+     * 月业绩导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionPerfMonthExport($taskId){
+        return $this->_export($taskId, PerfMonthList::class, '月业绩列表');
+    }
+
+    /**
+     * 达标业绩导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionPerfStandardExport($taskId){
+        return $this->_export($taskId, PerfStandardList::class, '达标业绩列表');
+    }
+
+    /**
+     * 月业绩导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionUserPerfExport($taskId){
+        return $this->_export($taskId, UserPerfList::class, '用户业绩列表');
+    }
+
+    /**
+     * 期业绩导出
+     * @param $taskId
+     * @return bool
+     */
+    public function actionPerfPeriodListExport($taskId){
+        return $this->_export($taskId, PerfPeriodList::class, '期业绩列表');
+    }
+
+    /**
+     * 导出方法
+     * @param $taskId
+     * @param $className
+     * @param $listName
+     * @return bool
+     */
+    private function _export($taskId, $className, $listName){
+        $factory = BonusExport::factory($taskId);
+        $factory->listModelClass = $className;
+        try {
+            if ($factory->generate()) {
+                \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($factory->getUserId(), $listName.'导出成功');
+            }
+            unset($factory, $taskId, $className, $listName);
+            return true;
+        } catch (\Exception $e) {
+            echo $listName.'导出失败。详情:' . $e->getMessage();
+            \Yii::$app->swooleAsyncTimer->pushAsyncResultToAdmin($factory->getUserId(), $listName.'导出失败。详情:' . $e->getMessage(), false);
+        }
+        unset($factory, $taskId, $className, $listName);
+        return false;
+    }
 }

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

@@ -69,7 +69,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'])];
@@ -235,7 +235,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'])];
@@ -257,7 +257,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'])];
@@ -365,7 +365,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']) {

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

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

+ 2 - 1
frontendEle/src/views/finance/transfer-add.vue

@@ -116,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
@@ -193,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';
+