| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <?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' => '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;
- }
- }
|