theo пре 3 година
родитељ
комит
f25482d1d4

+ 399 - 0
backendApi/modules/v1/models/lists/shop/BaOrderList.php

@@ -0,0 +1,399 @@
+<?php
+namespace backendApi\modules\v1\models\lists\shop;
+
+use common\helpers\Cache;
+use common\helpers\Tool;
+use common\helpers\user\Info;
+use common\libs\dataList\DataListInterface;
+
+use common\models\BaApproachOrder;
+use common\models\BaApproachOrderGoods;
+use common\models\BaOrder;
+use common\models\BaOrderGoods;
+
+use common\models\ShopGoods;
+use common\models\BaUser;
+use common\libs\dataList\column\DateTime;
+use yii\data\Pagination;
+use yii\db\Query;
+
+class BaOrderList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return 'BA订单列表';
+    }
+
+    /**
+     * 列表筛选到的数据
+     */
+    public function dataHandle()
+    {
+        $orderQuery = BaOrder::find()
+            ->alias('O')
+            ->where($this->condition, $this->params)
+            ->select('O.*,U.REAL_NAME,U.DEC_ID,SG.CATEGORY_TYPE,OG.REAL_PRICE,OG.TAX_RATE,OG.BUY_NUMS,OG.SKU_CODE,OG.GOODS_TITLE,OG.REAL_PV')
+            ->join('LEFT JOIN', BaUser::tableName() . ' AS U', 'U.ID=O.USER_ID')
+            ->join('LEFT JOIN', BaOrderGoods::tableName() . ' AS OG', 'OG.ORDER_SN=O.SN')
+            ->join('LEFT JOIN', ShopGoods::tableName() . ' AS SG', 'SG.ID=OG.GOODS_ID')
+            ->orderBy('O.CREATED_AT DESC');
+
+        // 订单中间表只查询待支付和支付失败的订单
+        $this->params[':NOT_PAID'] = \Yii::$app->params['orderStatus']['notPaid']['value'];   // 待支付
+        $this->params[':FAIL_PAID'] = \Yii::$app->params['orderStatus']['failPaid']['value'];   // 支付失败
+        $orderStandardQuery = BaApproachOrder::find()
+            ->alias('O')
+            ->where($this->condition . ' AND (O.STATUS = :NOT_PAID OR O.STATUS = :FAIL_PAID)', $this->params)
+            ->select('O.*,U.REAL_NAME,U.DEC_ID,SG.CATEGORY_TYPE,OG.REAL_PRICE,OG.TAX_RATE,OG.BUY_NUMS,OG.SKU_CODE,OG.GOODS_TITLE,OG.REAL_PV')
+            ->join('LEFT JOIN', BaUser::tableName() . ' AS U', 'U.ID=O.USER_ID')
+            ->join('LEFT JOIN', BaApproachOrderGoods::tableName() . ' AS OG', 'OG.ORDER_SN=O.SN')
+            ->join('LEFT JOIN', ShopGoods::tableName() . ' AS SG', 'SG.ID=OG.GOODS_ID')
+            ->orderBy('O.CREATED_AT DESC');
+
+        $queryAll = $orderQuery->union($orderStandardQuery, true);
+        $query = (new Query())->from(['Q' => $queryAll])->select('Q.*')->distinct()->orderBy(['CREATED_AT' => SORT_DESC]);
+
+        $totalCount = $query->count();
+        $pagination = new Pagination(['totalCount' => $totalCount, 'pageSize' => \Yii::$app->request->get('pageSize')]);
+        $lists = $query->offset($pagination->offset)->limit($pagination->limit)->all();
+
+        $this->listData = [
+            'list' => $lists,
+            'currentPage'=>$pagination->page,
+            'totalPages'=>$pagination->pageCount,
+            'startNum' => $pagination->page * $pagination->pageSize + 1,
+            'totalCount' => $pagination->totalCount,
+            'pageSize' => $pagination->pageSize,
+        ];
+
+        foreach ($this->listData['list'] as $key => $value) {
+            $CREATE_USER_ID = Info::getUserIdByUserName($value['CREATE_USER']);
+            $this->listData['list'][$key]['DEC_USER_NAME'] = Info::getUserNameByUserId($value['DEC_ID']);
+            $this->listData['list'][$key]['CREATE_USER_NAME'] = Info::getUserRealNameByUserId($CREATE_USER_ID);
+//            $this->listData['list'][$key]['GOODS_NO'] = '';
+        }
+    }
+
+    /**
+     * 要展示和导出的所有字段
+     * @return array
+     */
+    public function getColumn(){
+        $regionConfig = Cache::getRegionConfig();
+        if(!$this->columns){
+            $this->columns = [
+                'ID' => null,
+                'DEC_SN' => null,
+                'USER_NAME' => [
+                    'header' => 'Member code',//会员编号
+                    'headerOther' => ['width' => '120'],
+                ],
+                'DEC_USER_NAME' => [
+                    'header' => 'Stockist', // 报单中心
+                    'headerOther' => ['width' => '120'],
+                ],
+                'CREATE_USER' => [
+                    'header' => 'Creator No',//创建人编号
+                    'headerOther' => ['width' => '120'],
+                ],
+                'CREATE_USER_NAME' => [
+                    'header' => 'Stockist Name',//创建人姓名
+                    'headerOther' => ['width' => '120'],
+                ],
+                'SN' => [
+                    'header' => 'Order Code',//订单号
+                    'headerOther' => ['width' => '200'],
+                ],
+//                'STATUS' => null,
+                'STATUS' => [
+                    'header' => 'Status',//订单状态
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                    'value' => function ($row) {
+                        return \Yii::$app->params['orderStatus'][$row['STATUS']]['label'] ?? '';
+                    },
+                ],
+                'SKU_CODE' => [
+                    'header' => 'Product Code',//存货编码
+                    'headerOther' => ['width' => '150'],
+                ],
+                'GOODS_TITLE' => [
+                    'header' => 'Product Name', // 存货名称
+                    'headerOther' => ['width' => '200'],
+                ],
+                'BUY_NUMS' => [
+                    'header' => 'Qty',//数量
+                    'headerOther' => ['width' => '100'],
+                ],
+                'CONSIGNEE' => [
+                    'header' => 'Recipient',//收货人
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'MOBILE' => [
+                    'header' => 'Contact 1',//联系方式1
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                ],
+                'TEL' => [
+                    'header' => 'Contact 2',//联系方式2
+                ],
+                'PROVINCE' => [
+                    'header' => 'State', // 州
+                    'headerOther' => ['width' => '120'],
+                    'value' => function ($row) use($regionConfig) {
+                        return $regionConfig[$row['PROVINCE']]['REGION_NAME'] ?? '';
+                    },
+                ],
+                'CITY' => [
+                    'header' => 'Local Government Area', // 地方政府
+                    'headerOther' => ['width' => '120'],
+                    'value' => function ($row) use($regionConfig) {
+                        return $regionConfig[$row['CITY']]['REGION_NAME'] ?? '';
+                    },
+                ],
+                'COUNTY' => [
+                    'header' => 'City', // 区
+                    'headerOther' => ['width' => '120'],
+                    'value' => function ($row) use($regionConfig) {
+                        return $regionConfig[$row['COUNTY']]['REGION_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' => 'Detailed Address',//详细地址
+                    'headerOther' => [
+                        'width' => '300',
+                    ],
+                ],
+                'PERIOD_NUM' => [
+                    'header' => 'Period',//期数
+                ],
+                'ORDER_TYPE' => [
+                    'header' => 'Order Type',//订单类型
+                    'headerOther' => ['width' => '120'],
+                    'value' => function ($row) {
+                        switch ($row['ORDER_TYPE']) {
+                            case 'ZC':
+                                return 'Welcome pack';
+                            case 'FX':
+                                return in_array($row['PAY_TYPE'], ['cash', 'pay_stack']) ? 'Reselling': 'Points'; //'重消' : '积分'
+                        }
+                    },
+                ],
+//                'WAREHOUSE' => [
+//                    'header' => 'Delivery warehouse',//发货仓
+//                ],
+                'CREATED_AT' => [
+                    'header' => 'Creation Time',//创建时间
+                    'value' => function ($row) {
+                        return (new DateTime([
+                            'value' => $row['CREATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '190'],
+                ],
+                'PAY_TYPE' => [
+                    'header' => 'Pay type',// 支付方式
+                    'value' => function ($row) {
+                        return ShopGoods::payTypes()[$row['PAY_TYPE']]['name'] ?? ShopGoods::payTypes()['cash']['name'];
+                    },
+                    'headerOther' => ['width' => '190'],
+                ],
+                'PAY_AT' => [
+                    'header' => 'Payment time',//支付时间
+                    'value' => function ($row) {
+                        return (new DateTime([
+                            'value' => $row['PAY_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '190'],
+                ],
+                'DELIVERY_AT' => [
+                    'header' => 'Delivery time',//发货时间
+                    'value' => function ($row) {
+                        return (new DateTime([
+                            'value' => $row['DELIVERY_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '190'],
+                ],
+                'REAL_PRICE' => [
+                    'header' => 'Item Pricing',//商品单价
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function ($row) {
+                        return Tool::formatPrice($row['REAL_PRICE']);
+                    },
+                    'valueOther' => function ($row) {
+                        return [
+                            'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
+                        ];
+                    },
+                ],
+                'REAL_PV' => [
+                    'header' => 'Commodity amount',//商品金额
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function ($row) {
+                        return Tool::formatPrice($row['REAL_PV']);
+                    },
+                    'valueOther' => function ($row) {
+                        return [
+                            'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
+                        ];
+                    },
+                ],
+                'PAY_FREIGHT' => [
+                    'header' => 'Freight',//运费
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function ($row) {
+                        return Tool::formatPrice($row['FREIGHT']);
+                    },
+                    'valueOther' => function ($row) {
+                        return [
+                            'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
+                        ];
+                    },
+                ],
+                'TAX_RATE' => [
+                    'header' => 'Tax Rate',//税率
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function ($row) {
+                        return Tool::formatPrice($row['TAX_RATE']);
+                    },
+                    'valueOther' => function ($row) {
+                        return [
+                            'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
+                        ];
+                    },
+                ],
+                'TAX_AMOUNT' => [
+                    'header' => 'Tax',//税额
+                    'headerOther' => [
+                        'width' => '150',
+                    ],
+                    'value' => function ($row) {
+                        return Tool::formatPrice(($row['REAL_PRICE'] - $row['REAL_PRICE'] / (1 + $row['TAX_RATE'] / 100)));
+                    },
+                    'valueOther' => function ($row) {
+                        return [
+                            'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
+                        ];
+                    },
+                ],
+                'EXPRESS_COMPANY' => [
+                    'header' => 'Courier Services Company',//快递公司
+                    'headerOther' => ['width' => '150'],
+                ],
+                'ORDER_TRACK_NO' => [
+                    'header' => 'Courier Number',//快递单号
+                    'headerOther' => ['width' => '200'],
+                ],
+                'EXPRESS_TYPE' => [
+                    'header' => 'Shipping Method',//发货方式
+                    'headerOther' => ['width' => '150'],
+                    'value' => function ($row) {
+                        return $row['EXPRESS_TYPE']==0 ? 'mailing ':' auto pick ';//'邮寄' : '自提'
+                    },
+                ],
+                'FRONT_REMARK' => [
+                    'header' => 'Member Notes',//会员备注
+                    'headerOther' => [
+                        'width' => '200',
+                    ],
+                    'value' => function ($row) {
+                        return $row['FRONT_REMARK'];
+                    },
+                    'showValue' => function ($row) {
+                        return '<div title="'.$row['FRONT_REMARK'].'" style="width:180px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">'.$row['FRONT_REMARK'].'</div>';
+                    },
+                ],
+                'DELIVERY_STATUS' => null,
+                'DELIVERY_STATUS_NAME' => [
+                    'header' => 'Shipment Status',//发货状态
+                    'headerOther' => [
+                        'width' => '110',
+                    ],
+                    'value' => function ($row) {
+                        return \Yii::$app->params['deliveryStatus'][$row['DELIVERY_STATUS']]['label'] ?? '';
+                    },
+                ],
+                'IS_AUTO' => [
+                    'header' => 'Is Auto', // 是否自动
+                    'value' => function ($row) {
+                        return $row['IS_AUTO'] == 1 ? 'Yes' : 'No';
+                    },
+                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [
+                'SN'=> ['name'=> 'Order No'],//订单编号
+                'USER_NAME'=> ['name'=> 'Member Code'],//会员编号
+                'MOBILE'=> ['name'=> 'Contact 1'],//联系方式1
+                'ORDER_TYPE'=> ['name'=> 'Order Type'],
+                'PERIOD_NUM'=> ['name'=> 'Number Of Periods'],//期数
+                'CREATED_AT'=> ['name'=> 'Creation Time', 'other'=>'date'],//创建时间
+                'STATUS'=> [
+                    'name'=> 'Status',
+                    'other'=> 'select',
+                    'selectData'=> [
+                        ['id' => \Yii::$app->params['orderStatus']['paid']['value'], 'name' => \Yii::$app->params['orderStatus']['paid']['label']],
+                        ['id' => \Yii::$app->params['orderStatus']['notPaid']['value'], 'name' => \Yii::$app->params['orderStatus']['notPaid']['label']],
+                        ['id' => \Yii::$app->params['orderStatus']['failPaid']['value'], 'name' => \Yii::$app->params['orderStatus']['failPaid']['label']]
+                    ]
+                ],
+                'IS_AUTO' => [
+                    'name'=>'Is Auto',
+                    'other'=> 'select',
+                    'selectData'=> [
+                        ['id'=>1, 'name'=>'YES'],
+                        ['id'=>0, 'name'=>'NO'],
+                    ]
+                ]
+            ];
+        }
+        return $this->filterTypes;
+    }
+}

+ 371 - 0
backendApi/modules/v1/models/lists/shop/BaUserList.php

@@ -0,0 +1,371 @@
+<?php
+namespace backendApi\modules\v1\models\lists\shop;
+
+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\BaUser;
+use common\models\BaUserInfo;
+use common\libs\dataList\column\DateTime;
+use common\libs\dataList\column\YesNo;
+use common\models\UserNetwork;
+use common\models\UserSystem;
+use Yii;
+
+class BaUserList extends \common\libs\dataList\DataList implements DataListInterface
+{
+    /**
+     * 列表名称
+     * @return string
+     */
+    public function getListName(){
+        return 'BA会员列表';
+    }
+
+    /**
+     * 列表筛选到的数据
+     */
+    public function dataHandle()
+    {
+//        $this->condition .= ' AND UN.USER_ID=UI.USER_ID AND UN.PARENT_UID=UI.CON_UID';
+        $this->listData = BaUser::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, 
+                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' => BaUser::tableName() . ' AS U',
+            'join' => [
+                ['LEFT JOIN', BaUserInfo::tableName() . ' AS UI', 'UI.USER_ID=U.ID'],
+//                ['LEFT JOIN', UserNetwork::tableName() . ' AS UN', 'UI.USER_ID=UN.USER_ID'],
+                ['LEFT JOIN', BaUser::tableName() . ' AS CU', 'UI.CON_UID=CU.ID'],
+                ['LEFT JOIN', BaUser::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
+                ['LEFT JOIN', BaUser::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();
+//        $crownLevelConfig = Cache::getStarCrownLevelConfig();
+//        $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' => 'Member code',//会员编号
+                    'headerOther' => ['width' => '150'],
+                ],
+                'REAL_NAME' => [
+                    'header' => 'Member name',//会员姓名
+                    'headerOther' => [
+                        'width' => '120',
+                    ],
+                    'valueOther' => [
+                        'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border']
+                    ],
+                ],
+                'LOGIN_STATUS_NAME' => [
+                    'header' => 'Login status',//登录状态
+                    'value' => function($row) {
+                        return $row['ALLOW_LOGIN'] == 1 ? 'allow Login': 'prohibit Login';//'允许登录' : '禁止登录'
+                    },
+                    'headerOther' => ['width' => '110'],
+                ],
+                'STATUS' => [
+                    'header' => 'Status',//状态
+                    'value' => function($row) {
+                        return $row['STATUS'] == 1 ? 'activate': 'lock';//'激活' : '锁定'
+                    },
+                    'headerOther' => ['width' => '110'],
+                ],
+                'ALLOW_LOGIN' => ['header' => 'Filter allow login','hidden'=>true],//筛选允许登录
+                'CREATED_AT' => [
+                    'header' => 'Joining Date', // 加入日期
+                    'value' => function($row) {
+                        return (new DateTime([
+                            'value' => $row['CREATED_AT'],
+                        ]))->result();
+                    },
+                    'headerOther' => ['width' => '170'],
+                ],
+//                'PERIOD_AT' => [
+//                    'header' => 'Joining Period',//加入期数
+//                    'headerOther' => ['width' => '180'],
+//                ],
+//                'DEC_LV_NAME' => [
+//                    'header' => 'Real time membership level',//实时会员级别
+//                    'headerOther' => [
+//                        'width' => '120',
+//                    ],
+//                    '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' => 'Real time adjustment date',//实时调整日期
+//                    'value' => function($row) {
+//                        return (new DateTime([
+//                            'value' => $row['DEC_LV_UPDATED_AT'],
+//                        ]))->result();
+//                    },
+//                    'headerOther' => ['width' => '160'],
+//                ],
+//                'LAST_DEC_LV_NAME' => [
+//                    'header' => 'PC Member Level', // 结算时会员级别
+//                    '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' => 'Real time employment',//实时聘级
+//                    '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']
+//                    ],
+//                ],
+//                'CROWN_LV_NAME' => [
+//                    'header' => 'Real time crown', // 实时星级
+//                    'headerOther' => [
+//                        'width' => '130',
+//                    ],
+//                    'value' => function($row) use($crownLevelConfig) {
+//                        return isset($crownLevelConfig[$row['CROWN_LV']])?$crownLevelConfig[$row['CROWN_LV']]['LEVEL_NAME']:'';
+//                    },
+//                    'valueOther' => [
+//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
+//                    ],
+//                ],
+                'REC_USER_NAME' => [
+                    'header' => 'Recommendation No',//推荐编号
+                    'headerOther' => ['width' => '150'],
+                ],
+                'REC_REAL_NAME' => [
+                    'header' => 'Recommended name',//推荐姓名
+                    'headerOther' => ['width' => '100'],
+                ],
+//                'CON_USER_NAME' => [
+//                    'header' => 'Placement No',//安置编号
+//                    'headerOther' => ['width' => '150'],
+//                ],
+//                'CON_REAL_NAME' => [
+//                    'header' => 'Placement Name',//安置姓名
+//                    'headerOther' => ['width' => '100'],
+//                ],
+                'MOBILE' => [
+                    'header' => 'Phone Number',//手机号码
+                    'value' => function($row) {
+                        return "\t".$row['MOBILE'];
+                    },
+                    'headerOther' => ['width' => '120'],
+                ],
+                'TEL' => [
+                    'header' => 'Alternate Phone Number', // 备用手机号码
+                    'value' => function($row) {
+                        return "\t".$row['TEL'];
+                    },
+                    'headerOther' => ['width' => '120'],
+                ],
+                'DEC_USER_NAME' => [
+                    'header' => 'Stockist Code', // 所属报单中心编号
+                    'headerOther' => ['width' => '150'],
+                ],
+//                'IS_DEC' => [
+//                    'header' => 'Declaration center or not',//是否报单中心
+//                    '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_ATLAS' => [
+//                    'header' => 'Whether the atlas is displayed',//是否显示图谱
+//                    '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' => 'Whether to display recharge',//是否显示充值
+//                    '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' => 'Stockist Level',//报单中心级别
+//                    'headerOther' => ['width' => '110'],
+//                    'value' => function($row) use($decRoleConfig) {
+//                        return $decRoleConfig[$row['DEC_ROLE_ID']]['ROLE_NAME'] ?? '';
+//                    },
+//                ],
+                'OPEN_BANK_NAME' => [
+                    'header' => 'Bank Name',//开户银行
+                    'headerOther' => ['width' => '110'],
+                    'value' => function($row) use($openBankConfig) {
+                        return $openBankConfig[$row['OPEN_BANK']]['BANK_NAME'] ?? '';
+                    },
+                ],
+                'BANK_NO' => [
+                    'header' => 'Bank account number',//银行帐号
+                    'headerOther' => ['width' => '220'],
+                    'value' => function($row) {
+                        return "\t".$row['BANK_NO'];
+                    },
+                ],
+                'AREA' => [
+                    'header' => 'Common address',//常用地址
+                    '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'
+                    ],
+                ],
+//                'ALLOW_TRANSFER' => [
+//                    'header' => 'Enable "Transfer"', // 转账功能开启
+//                    'value' => function($row) {
+//                        return $row['ALLOW_TRANSFER'] == 1 ? 'on': 'off';//'开启' : '关闭'
+//                    },
+//                    'headerOther' => function($row) {
+//                        return [
+//                            'width' => '120',
+//                        ];
+//                    },
+//                    'valueOther' => function($row) {
+//                        return [
+//                            'tag'=>['type'=>(isset($row['ALLOW_TRANSFER']) && $row['ALLOW_TRANSFER']) ? 'success' : 'info', 'size' => 'small']
+//                        ];
+//                    },
+//                ],
+            ];
+        }
+        return $this->columns;
+    }
+
+    /**
+     * 前台用于筛选的类型集合
+     * @return mixed
+     */
+    public function getFilterTypes()
+    {
+        if(!$this->filterTypes){
+            $this->filterTypes = [
+                'USER_NAME'=> ['name'=> 'Member code'], // 会员编号
+                'REAL_NAME'=> ['name'=> 'Member name'], // 会员姓名
+                'CREATED_AT'=> ['name'=> 'Joining Date', 'other'=> 'date'], // 加入日期
+                'PERIOD_AT'=> ['name'=> 'Joining Period'], // 加入期数
+                'DEC_LV_NAME'=> ['name'=> 'Real time membership level', 'other'=> 'decLevel'], // 实时会员级别
+                'EMP_LV_NAME'=> ['name'=> 'Real time employment', 'other'=> 'empLevel'], // 实时聘级
+                'CROWN_LV_NAME'=> ['name'=> 'Real time Crown', 'other'=> 'crownLevel'], // 实时聘级
+                'REC_USER_NAME'=> ['name'=> 'Recommendation No'],//推荐编号
+                'CON_USER_NAME'=> ['name'=> 'Placement No'],//安置编号
+                'ID_CARD'=> ['name'=> 'Identification Number'],//证件号码
+                'MOBILE'=> ['name'=> 'Phone Number'],//手机号码
+                'DEC_USER_NAME'=> ['name'=> 'Stockist Code'], // 所属报单中心编号
+                'IS_DEC'=> ['name'=> 'Declaration center or not', 'other'=> 'yesOrNo'],//是否报单中心
+                'IS_STUDIO'=> ['name'=> 'Studio or not', 'other'=> 'yesOrNo'],//是否工作室
+                'DEC_ROLE_NAME'=> ['name'=> 'Stockist Level', 'other'=> 'decRole'],//报单中心级别
+                'AREA'=> ['name'=> 'Common address', 'other'=> 'area'],//常用地址
+                'STATUS'=> ['name'=> 'Active status', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> 'locking'],['id'=> 1, 'name'=> 'activation']]],
+            ];
+        }
+        return $this->filterTypes;
+    }
+}