登录

@return array
973746
public function actionLogin()
    {
        $model = new LoginForm();
        if ($model->load(Yii::$app->request->post(), '')) {
            if ($model->login()) {
                /* @var $identity \wsl\rbac\models\DpAdminUser */
                $identity = Yii::$app->user->identity;
                $groupNames = $identity->getGroupNames();
                $user = [
                    'username' => $identity->username,
                    'nickname' => $identity->nickname,
                    'isSuper' => $identity->is_super,
                    'groupName' => join(',', $groupNames),
                ];
                return $this->renderSuccess('登录成功', [
                    'user' => $user
                ]);
            } else {
                foreach ($model->getErrors() as $error) {
                    foreach ($error as $msg) {
                        return $this->renderError($msg);
                    }
                }
            }
        }

        return $this->renderError('非法请求');
    }
211490
public function toArray() {
		return [
			'key' => $this->key(),
			'url' => $this->url(),
			'formData' => $this->formData(),
			'cacheControl' => $this->cacheControl(),
			'expires' => $this->expires(),
			'acl' => $this->acl()
		];
	}
141326
public function getPostParams()
    {
        if (is_array($this->postParams)) {
            return $this->postParams;
        }
        
        //$posts = $this->getParsedBody();  // 可能是 xml 对象
        if (($input = static::getPostInputInfo())) {
            $this->postParams = $input[1];
        } else {
            $this->postParams = $_POST;
        }
        
        return $this->postParams;
    }
748064
final public function getMeta()
    {
        static $tableMetas = [];
        $tableName = $this->getTable();

        if (isset($tableMetas[$tableName])) {
            return $tableMetas[$tableName];
        }
        $sql = 'describe ' . $tableName;
        $this->sql = $sql;
        /**
         * 仅仅获得sql
         */
        if ($this->justSql) {
            return [];
        }
        $this->DB->query($sql);
        $this->lastQueryAt = time();
        $rows = $this->DB->fetchAll(\PDO::FETCH_ASSOC);
        $metaData = [];
        foreach ($rows as $row) {
            $metaData[] = [
                'field' => $row['Field'],
                'typeArr' => $this->parseType($row['Type']),
                'type' => $this->parseType($row['Type'])[0],
                'null' => $row['Null'] == 'NO' ? false : true,//是否可以是NULL
                'key' => $row['Key'],
                'default' => $row['Default'],
                'extra' => $row['Extra']
            ];
        }
        $tableMetas[$tableName] = $metaData;
        return $metaData;
    }
1088770
public function toArray()
    {
        $result = [];
        $result['id']            = $this->id;
        $result['toUserName']    = $this->toUserName;
        $result['fromUserName']  = $this->fromUserName;
        $result['createTime']    = $this->createTime;
        $result['msgType']       = $this->msgType;
        return $result;
    }
1109204
public function getQueries()
    {
        return array_merge(
            $this->getDropSequenceQueries(),
            $this->getDropViewQueries(),
            $this->getRenameTableQueries(),
            $this->getDropCheckQueries(),
            $this->getDropForeignKeyQueries(),
            $this->getDropIndexQueries(),
            $this->getDropPrimaryKeyQueries(),
            $this->getDropTableQueries(),
            $this->getDropColumnQueries(),
            $this->getAlterColumnQueries(),
            $this->getCreateColumnQueries(),
            $this->getCreateTableQueries(),
            $this->getCreatePrimaryKeyQueries(),
            $this->getCreateIndexQueries(),
            $this->getCreateForeignKeyQueries(),
            $this->getCreateCheckQueries(),
            $this->getCreateViewQueries(),
            $this->getCreateSequenceQueries(),
            $this->getRenameSchemaQueries()
        );
    }
979704
public function getData()
    {
        $this->validate('orderId', 'txnTime', 'accNo', 'payTimeout');

        $data = array(
            'version'       => $this->getVersion(),  //版本号
            'encoding'      => $this->getEncoding(),  //编码方式
            'certId'        => $this->getTheCertId(),    //证书ID
            'signMethod'    => $this->getSignMethod(),  //签名方法
            'txnType'       => '79',        //交易类型
            'txnSubType'    => '00',        //交易子类
            'bizType'       => '000902',    //业务类型
            'accessType'    => $this->getAccessType(),         //接入类型
            'channelType'   => $this->getChannelType(), //05:语音 07:互联网 08:移动
            'encryptCertId' => CertUtil::readX509CertId($this->getEncryptKey()),
            'merId'         => $this->getMerId(),     //商户代码
            'orderId'       => $this->getOrderId(),     //商户订单号，填写开通并支付交易的orderId
            'txnTime'       => $this->getTxnTime(),    //订单发送时间
            'tokenPayData'  => sprintf('{trId=%s&tokenType=01}', $this->getTrId()), //标记请求者 trId
            'accNo'         => $this->encrypt($this->getAccNo()), //银行卡号
            'customerInfo'  => $this->getEncryptCustomerInfo(), //标记请求者 trId,
            'frontUrl'      => $this->getReturnUrl(), //前台通知地址
            'backUrl'       => $this->getNotifyUrl(), //后台通知地址
            'payTimeout'    => $this->getPayTimeout(), //订单超时时间
        );

        $data = $this->filter($data);

        $data['signature'] = $this->sign($data, 'RSA2');

        return $data;
    }
432256
public function toArray()
    {
        $array = array(
            'firstName'   => $this->firstName,
            'lastName'    => $this->lastName,
            'email'       => $this->email,
            'telephone'   => $this->phoneNumber,
            'mobile'      => $this->mobileNumber,
            'companyName' => $this->companyName,
        );
        if ($this->address !== null) {
            $array['address'] = $this->address->toArray();
        }

        return $array;
    }
1241312
public function toArray()
    {
        return [
            'id' => $this->id,
            'author' => $this->author,
            'title' => $this->title,
            'date' => $this->date->format('U'),
            'component' => $this->component,
            'image' => $this->image,
            'handler' => $this->handler,
        ];
    }
741365
public function getValues()
    {
        $result = [];
        $defaults = $this->defaults();
        foreach ($defaults as $name => $value) {
            if ($this->getData()->has($name)) {
                $result[$name] = $this->getData()->get($name);
            } else {
                $result[$name] = $value;
            }
        }
        return $result;
    }
486288
public function get()
    {
        $parameters = [];
        foreach ($this->parameters as $parameter) {
            $parameters[] = $parameter->get();
        }

        return [
            'type' => 'new',
            'class' => $this->className,
            'parameters' => $parameters,
            'dynamic' => $this->dynamic,
            'file' => $this->file,
            'line' => $this->line,
            'char' => $this->char,
        ];
    }
941213
public function toArray() {

        return [
            'uid' => $this->uid,
            'method' => $this->method,
            'parameters' => $this->parameters,
            'special_types' => $this->special_types,
            'id' => $this->id
        ];

    }
754688
public function getData()
    {
        return [
            'recipient' => $this->user_ref ? ['user_ref' => $this->recipient] : ['id' => $this->recipient],
            'message' => [
                'text' => $this->text
            ],
            'tag'=> $this->tag,
            'notification_type'=> $this->notification_type,
            'messaging_type' => $this->messaging_type
        ];
    }
857171
protected function getValues()
    {
        $uri = uri();
        $key = $this->session->has($uri) ? $uri : request()->path();

        $params = $this->session->get($key . '.' . get_called_class());
        if (is_null($params) or ! isset($params['column']) or ! $params['column'] == $this->column) {
            return [];
        }
        if (!isset($params['value'])) {
            return [];
        }
        if (empty((array) $params['value'])) {
            $params = $this->session->get($uri);
            unset($params[get_called_class()]);
            $this->session->put($key, $params);
            $this->session->save();
        } else {
            return $params['value'];
        }
        return [];
    }
280617
public function data()
    {
        return [
            'property'  => $this->property(),
            'table'     => $this->table(),
            'direction' => $this->direction(),
            'mode'      => $this->mode(),
            'values'    => $this->values(),
            'condition' => $this->condition(),
            'active'    => $this->active(),
            'name'      => $this->name(),
        ];
    }
1008446
public function getFields() {
        $fields = $this->_fields;

        if ($this->getJoins() && !$fields && $this->getType() === self::SELECT) {
            return array_keys($this->getRepository()->getSchema()->getColumns());
        }

        return $fields;
    }
551793
public static function GetPdoParamList () {
		return [
			//数値
			'INTEGER'			=> \PDO::PARAM_INT,
			'NUMERIC'			=> \PDO::PARAM_STR,
			'REAL'				=> \PDO::PARAM_STR,
			//文字・文字列
			'TEXT'				=> \PDO::PARAM_STR,
			//バイナリ
			'NONE'				=> \PDO::PARAM_LOB,
		];
	}