Пример #1
0
 /**
  * Query member's name
  *
  * <b>Request Type</b>: GET<br/><br/>
  * <b>Request Endpoint</b>:http://{server-domain}/api/member/member/name<br/><br/>
  * <b>Response Content-type</b>: application/json<br/><br/>
  * <b>Summary</b>: This api is used for querying member's name.
  * <br/><br/>
  *
  * <b>Request Params</b>:<br/>
  *     name: string<br/>
  *     <br/><br/>
  *
  * <b>Response Params:</b><br/>
  *     <br/><br/>
  *
  * <br/><br/>
  *
  * <b>Response Example</b>:<br/>
  * [
  *  "hank",
  *  "hanken"
  * ]
  * <pre>
  * </pre>
  */
 public function actionName()
 {
     $name = $this->getQuery('name');
     $accountId = $this->getAccountId();
     $rows = Member::searchByName($accountId, $name);
     $result = [];
     foreach ($rows as $row) {
         $properties = $row['properties'];
         foreach ($properties as $property) {
             if ($property['name'] == Member::DEFAULT_PROPERTIES_NAME) {
                 $result[] = $property['value'];
             }
         }
     }
     $result = array_unique($result);
     return array_values($result);
 }