本文整理汇总了PHP中backend\models\User::getByAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getByAccount方法的具体用法?PHP User::getByAccount怎么用?PHP User::getByAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backend\models\User
的用法示例。
在下文中一共展示了User::getByAccount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
/**
* View user list
*
* <b>Request Type</b>: GET<br/><br/>
* <b>Request Endpoint</b>:http://{server-domain}/management/user<br/><br/>
* <b>Content-type</b>: application/json<br/><br/>
* <b>Summary</b>: This api is used for billing account to view user list
* <br/><br/>
*
*
* <b>Response Params:</b><br/>
* ack: integer, mark the create result, 0 means create successfully, 1 means create fail<br/>
* data: array, json array to return true<br/>
* <br/><br/>
*
*
* <b>Response Example</b>:<br/>
* <pre>
* {
* 'ack' : 1,
* 'data': [
* {
* 'name': 'Sara Zhang',
* 'email': 'sarazhang@augmentum.com.cn,
* 'id': gjdfjg465464567j43,
* 'role': 'admin',
* 'isActivated': true,
* 'avatar': 'http://www.hello.jpg'
* }
* ]
* }
* </pre>
*/
public function actionIndex()
{
$accountId = $this->getAccountId();
$userList = User::getByAccount($accountId);
$tmpList = [];
foreach ($userList as $user) {
$name = empty($user['name']) ? '' : $user['name'];
if (empty($user['consultManager'])) {
$u = ['name' => $name, 'email' => $user['email'], 'id' => $user['_id'] . '', 'role' => $user['role'], 'isActivated' => $user['isActivated'], 'avatar' => $user['avatar']];
$tmpList[] = $u;
}
}
return $tmpList;
}