| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <?php
- namespace backendApi\modules\v1\models\lists\user;
- use backendApi\modules\v1\models\Admin;
- 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\UserMove;
- use common\models\UserNetwork;
- use common\models\UserSystem;
- use Yii;
- class MoveList extends \common\libs\dataList\DataList implements DataListInterface
- {
- /**
- * 列表名称
- * @return string
- */
- public function getListName(){
- return '会员移网列表';
- }
- /**
- * 列表筛选到的数据
- */
- public function dataHandle()
- {
- $this->listData = User::lists($this->condition, $this->params, [
- 'select' => 'UM.*,
- CU.USER_NAME MOVE_USER_NAME,CU.REAL_NAME MOVE_REAL_NAME,FUI.USER_NAME FROM_USER_NAME,TUI.USER_NAME TO_USER_NAME,ADMC.ADMIN_NAME MOVE_ADMIN_NAME,ADMU.ADMIN_NAME AUDIT_ADMIN_NAME
- ',
- 'orderBy' => 'UM.CREATED_AT DESC, UM.ID DESC',
- 'from' => UserMove::tableName() . ' AS UM',
- 'join' => [
- ['LEFT JOIN', User::tableName() . ' AS CU', 'UM.USER_ID=CU.ID'],
- ['LEFT JOIN', UserInfo::tableName() . ' AS FUI', 'UM.FROM_UID=FUI.USER_ID'],
- ['LEFT JOIN', UserInfo::tableName() . ' AS TUI', 'UM.TO_UID=TUI.USER_ID'],
- ['LEFT JOIN', Admin::tableName() . ' AS ADMC', 'UM.MOVE_ADMIN_ID=ADMC.ID'],
- ['LEFT JOIN', Admin::tableName() . ' AS ADMU', 'UM.AUDIT_ADMIN_ID=ADMU.ID'],
- ],
- 'page' => $this->page,
- 'pageSize' => $this->pageSize,
- ]);
- }
- /**
- * 要展示和导出的所有字段
- * @return array
- */
- public function getColumn(){
- if(!$this->columns){
- $this->columns = [
- 'ID' => null,
- 'USER_ID' => null,
- 'MOVE_USER_NAME' => [
- 'header' => Yii::t('ctx', 'moveMember'),
- 'headerOther' => ['width' => '120'],
- ],
- 'MOVE_REAL_NAME' => [
- 'header' => Yii::t('ctx', 'moveMemberName'),
- 'headerOther' => ['width' => '200'],
- 'valueOther' => [
- 'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border']
- ],
- ],
- 'FROM_USER_NAME' => [
- 'header' => Yii::t('ctx', 'uperCodeBeforeMoving'),
- 'headerOther' => ['width' => '120'],
- ],
- 'TO_USER_NAME' => [
- 'header' => Yii::t('ctx', 'uperCodeAfterMoving'),
- 'headerOther' => ['width' => '120'],
- ],
- 'TYPE' => [
- 'header' => Yii::t('ctx', 'typeOfMoving'),
- 'headerOther' => ['width' => '120'],
- 'value' => function($row) {
- return $row['TYPE'] == UserMove::TYPE_NETWORK ? Yii::t('ctx', 'placementNetwork') : Yii::t('ctx', 'sponsorNetwork');
- },
- ],
- 'LOCATION' => [
- 'header' => Yii::t('ctx', 'position'),
- 'headerOther' => ['width' => '100'],
- 'value' => function($row) {
- return $row['LOCATION'] == 1 ? Yii::t('ctx', 'I.Market') : Yii::t('ctx', 'II.Market');
- },
- ],
- 'PERIOD_NUM' => [
- 'header' => Yii::t('ctx', 'periodOfMoving'),
- 'headerOther' => ['width' => '130'],
- ],
- 'IS_MOVING' => [
- 'header' => Yii::t('ctx', 'whetherToMove'),
- 'headerOther' => ['width' => '130'],
- ],
- 'MOVE_PERCENT' => [
- 'header' => Yii::t('ctx', 'percentage'),
- 'headerOther' => ['width' => '100'],
- ],
- 'MOVE_ADMIN_NAME' => [
- 'header' => Yii::t('ctx', 'AdministratorOfMoving'),
- 'headerOther' => ['width' => '180'],
- ],
- 'CREATED_AT' => [
- 'header' => Yii::t('ctx', 'joiningDate'),
- 'value' => function($row) {
- return (new DateTime([
- 'value' => $row['CREATED_AT'],
- ]))->result();
- },
- 'headerOther' => ['width' => '170'],
- ],
- 'AUDIT_STATUS' => null,
- 'AUDIT_STATUS_NAME' => [
- 'header' => Yii::t('ctx', 'status'),
- 'headerOther' => ['width' => '100'],
- 'value' => function ($row) {
- return UserMove::getStatusName()[$row['AUDIT_STATUS']];
- },
- ],
- 'AUDIT_ADMIN_NAME' => [
- 'header' => Yii::t('ctx', 'administratorOfReviewing'),
- 'headerOther' => ['width' => '150'],
- ],
- 'AUDITED_AT' => [
- 'header' => Yii::t('ctx', 'reviewTime'),
- 'value' => function ($row) {
- return (new DateTime([
- 'value' => $row['AUDITED_AT'],
- ]))->result();
- },
- 'headerOther' => ['width' => '150'],
- ],
- ];
- }
- return $this->columns;
- }
- /**
- * 前台用于筛选的类型集合
- * @return mixed
- */
- public function getFilterTypes()
- {
- if(!$this->filterTypes){
- $this->filterTypes = [
- 'MOVE_USER_NAME'=> ['isUserTable' => false,'name'=> Yii::t('ctx', 'moveMember')],
- 'MOVE_REAL_NAME'=> ['isUserTable' => false,'name'=> Yii::t('ctx', 'moveMemberName')],
- 'filterStatus'=> ['isUserTable' => false,'name'=> Yii::t('ctx', 'status')],
- 'PERIOD_NUM'=> ['isUserTable' => false,'name'=> Yii::t('ctx', 'periodOfMoving')],
- 'MOVE_ADMIN_NAME'=> ['isUserTable' => false,'name'=> Yii::t('ctx', 'AdministratorOfMoving')], // 移网管理员
- 'AUDIT_ADMIN_NAME'=> ['isUserTable' => false,'name'=> Yii::t('ctx', 'administratorOfReviewing')], // 审核管理员
- 'AUDITED_AT' => ['isUserTable' => false, 'name' => Yii::t('ctx', 'reviewTime'), 'other' => 'Review Time'], // 审核时间
- ];
- }
- return $this->filterTypes;
- }
- }
|