Files
2026-03-15 01:27:05 +08:00

46 lines
1.4 KiB
PHP
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/common/common.inc.php';
require_once dirname(dirname(dirname(__FILE__))) . '/common/BaseMethodHelper.php';
class test extends BaseMethod
{
/**
* 被请求方法示例参数固定为RequestParameter和ReturnParameter对象返回值固定为true(成功)和false(失败)
* @param RequestParameter $request
* @param ReturnParameter $return
* @return bool
*/
public function test_1($request, &$return)
{
global $out;
$out = array();
//$cmd = $this->NewMasterCommand();
$cmd = $this->NewServantCommand();
if (!is_null($cmd))
{
$return->biz_content = $cmd->select('play_nickname')->from('player')->withpage(1, 4)->limit(2)->request();
if (!$return->biz_content)
$return->SetErrors($this->GetErrorCode(), $this->GetErrorInfo());
$tables = $cmd->GetConnection()->GetTables();
/** @var ITable $player */
$player = $tables->player;
echo 'name: ', $player->getname(), '<br>', PHP_EOL;
echo 'fields: ', '<br>', PHP_EOL;
echo "  {$player->play_playerid->getname()}({$player->play_playerid->gettype()})<br>", PHP_EOL;
echo "  {$player->play_nickname->getname()}({$player->play_nickname->gettype()})<br>", PHP_EOL;
return true;
}
else
{
$return->biz_content = $this->pdo_request(/** @lang text */'select play_nickname from player limit 0, 4');
$return->seterrors($this->geterrorcode(), $this->geterrorinfo());
return $this->pdo_isdone();
}
}
}