添加后台代理代码
This commit is contained in:
45
codes/agent/game/dlweb/api/lib/2.0/test.php
Normal file
45
codes/agent/game/dlweb/api/lib/2.0/test.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user