示例#1
0
 /**
  * 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;
 }