info@User ok
This commit is contained in:
parent
ac74da7a13
commit
11d3b7cdf4
27
doc/User.py
27
doc/User.py
@ -19,6 +19,33 @@ class User(object):
|
|||||||
['info',_common.UserInfo(), '用户信息']
|
['info',_common.UserInfo(), '用户信息']
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': 'update',
|
||||||
|
'desc': '更新用户信息',
|
||||||
|
'group': 'User',
|
||||||
|
'url': 'webapp/index.php?c=User&a=update',
|
||||||
|
'params': [
|
||||||
|
_common.ReqHead(),
|
||||||
|
['hero_id', 0, '更新上阵英雄id(可选参数,不传就不更新)']
|
||||||
|
],
|
||||||
|
'response': [
|
||||||
|
_common.RspHead(),
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'info',
|
||||||
|
'desc': '获取用户信息',
|
||||||
|
'group': 'User',
|
||||||
|
'url': 'webapp/index.php?c=User&a=info',
|
||||||
|
'params': [
|
||||||
|
_common.ReqHead(),
|
||||||
|
['target_id', '', '用户account_id(如果要获取自己的就传自己的account_id)']
|
||||||
|
],
|
||||||
|
'response': [
|
||||||
|
_common.RspHead(),
|
||||||
|
['info',_common.UserInfo(), '用户信息']
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'name': 'clientBattleReport',
|
'name': 'clientBattleReport',
|
||||||
'desc': '客户端战报',
|
'desc': '客户端战报',
|
||||||
|
@ -38,6 +38,7 @@ class UserInfo(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.fields = [
|
self.fields = [
|
||||||
|
['account_id', '', '账号id'],
|
||||||
['name', '', '用户名字'],
|
['name', '', '用户名字'],
|
||||||
['head_id', 0, '头像id'],
|
['head_id', 0, '头像id'],
|
||||||
['head_frame', 0, '头像框id'],
|
['head_frame', 0, '头像框id'],
|
||||||
|
@ -91,6 +91,32 @@ class UserController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function update()
|
||||||
|
{
|
||||||
|
$validFields = array(
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function info()
|
||||||
|
{
|
||||||
|
$targetId = getReqVal('target_id', '');
|
||||||
|
$userDb = SqlHelper::ormSelectOne
|
||||||
|
($this->_getMysql($targetId),
|
||||||
|
't_user',
|
||||||
|
array(
|
||||||
|
'account_id' => $targetId
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (!$userDb) {
|
||||||
|
$this->_rspErr(1, '账号不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$this->_rspData(array(
|
||||||
|
'info' => User::info($userDb)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
public function clientBattleReport()
|
public function clientBattleReport()
|
||||||
{
|
{
|
||||||
$this->_updateUserInfo(array(
|
$this->_updateUserInfo(array(
|
||||||
|
@ -7,6 +7,24 @@ class User extends BaseModel {
|
|||||||
public static function show($row)
|
public static function show($row)
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
'account_id' => $row['account_id'],
|
||||||
|
'name' => $row['name'],
|
||||||
|
'sex' => $row['sex'],
|
||||||
|
'head_id' => $row['hero_id'],
|
||||||
|
'head_frame' => $row['head_frame'],
|
||||||
|
'level' => $row['level'],
|
||||||
|
'exp' => $row['exp'],
|
||||||
|
'gold' => $row['gold'],
|
||||||
|
'diamond' => $row['diamond'],
|
||||||
|
'hero_id' => $row['hero_id'],
|
||||||
|
'first_fight' => $row['first_fight'],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function info($row)
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'account_id' => $row['account_id'],
|
||||||
'name' => $row['name'],
|
'name' => $row['name'],
|
||||||
'sex' => $row['sex'],
|
'sex' => $row['sex'],
|
||||||
'head_id' => $row['hero_id'],
|
'head_id' => $row['hero_id'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user