This commit is contained in:
aozhiwei 2022-05-22 16:31:10 +08:00
parent c5b6b1669c
commit 66b404bc2f
2 changed files with 38 additions and 0 deletions

View File

@ -83,6 +83,20 @@ class User(object):
['info',_common.UserInfo(), '用户信息'],
]
},
{
'name': 'query',
'desc': '通过名字查询用户信息(精准查询)',
'group': 'User',
'url': 'webapp/index.php?c=User&a=query',
'params': [
_common.ReqHead(),
['name', '', '角色名']
],
'response': [
_common.RspHead(),
['info',_common.UserInfo(), '用户信息'],
]
},
{
'name': 'detailInfo',
'desc': '获取用户信息(详细)',

View File

@ -367,6 +367,30 @@ class UserController extends BaseAuthedController {
));
}
public function query()
{
$name = getReqVal('name', '');
$userDb = SqlHelper::ormSelectOne
($this->_getMysql($name),
't_user',
array(
'name' => $name
)
);
if (!$userDb) {
$this->_rspErr(1, 'not found');
return;
}
$channel = phpcommon\extractChannel($userDb['account_id']);
if ($channel != BC_CHANNEL) {
$this->_rspErr(1, 'not found');
return;
}
$this->_rspData(array(
'info' => User::info($userDb)
));
}
public function detailInfo()
{
$targetId = getReqVal('target_id', '');