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' => 'Mobile members',//移动的会员 'headerOther' => ['width' => '150'], ], 'MOVE_REAL_NAME' => [ 'header' => 'Mobile members name',//移动的会员名字 'headerOther' => [ 'width' => '150', ], 'valueOther' => [ 'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border'] ], ], 'FROM_USER_NAME' => [ 'header' => 'Move front contact',//移动前接点 'headerOther' => ['width' => '150'], ], 'TO_USER_NAME' => [ 'header' => 'Moving rear contact',//移动后接点 'headerOther' => ['width' => '150'], ], 'TYPE' => [ 'header' => 'Network transfer type',//移网类型 'headerOther' => [ 'width' => '120', ], 'value' => function($row) { return $row['TYPE'] == UserMove::TYPE_NETWORK ? 'placement network':'development network';//'安置网络' : '开拓网络' }, ], 'LOCATION' => [ 'header' => 'Move to position',//移动到位置 'headerOther' => ['width' => '150'], ], 'PERIOD_NUM' => 'Number of periods when moving',//移动时的期数 'IS_MOVING' => [ 'header' => 'Are you moving',//是否正在移动 'headerOther' => ['width' => '100'], ], 'MOVE_PERCENT' => [ 'header' => 'Movement percentage',//移动百分比 ], 'MOVE_ADMIN_NAME' => [ 'header' => 'Mobile administrator',//移网管理员 'headerOther' => ['width' => '120'], ], 'CREATED_AT' => [ 'header' => 'Date of accession',//加入日期 'value' => function($row) { return (new DateTime([ 'value' => $row['CREATED_AT'], ]))->result(); }, 'headerOther' => ['width' => '170'], ], 'AUDIT_STATUS' => null, 'AUDIT_STATUS_NAME' => [ 'header' => 'Audit status',//审核状态 'headerOther' => ['width' => '100'], 'value' => function ($row) { return UserMove::STATUS_NAME[$row['AUDIT_STATUS']]; }, ], 'AUDIT_ADMIN_NAME' => [ 'header' => 'Audit administrator',//审核管理员 'headerOther' => ['width' => '100'], ], 'AUDITED_AT' => [ 'header' => 'Audit time',//审核时间 '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'=> 'Mobile members'],//移动的会员 'MOVE_REAL_NAME'=> ['isUserTable' => false,'name'=> 'Mobile members name'],//移动的会员姓名 'filterStatus'=> ['isUserTable' => false,'name'=> 'Audit status'],//审核状态 // 'moveType'=> ['isUserTable' => false,'name'=> '移网类型', 'other'=> 'select','selectData'=>UserMove::TYPE_NAME], // 'FROM_USER_NAME'=> ['isUserTable' => false,'name'=> '移动前接点'], // 'TO_USER_NAME'=> ['isUserTable' => false,'name'=> '移动后接点', 'other'=> 'decLevel'], 'PERIOD_NUM'=> ['isUserTable' => false,'name'=> 'Number of periods when moving'],//移动时的期数 'MOVE_ADMIN_NAME'=> ['isUserTable' => false,'name'=> 'Mobile administrator'],//移网管理员 'AUDIT_ADMIN_NAME'=> ['isUserTable' => false,'name'=> 'Audit administrator'],//审核管理员 // 'CREATED_AT' => ['isUserTable' => false, 'name' => '申请时间', 'other' => 'date'], 'AUDITED_AT' => ['isUserTable' => false, 'name' => 'Audit time', 'other' => 'date'],//审核时间 ]; } return $this->filterTypes; } }