Ejemplo n.º 1
0
 /**
  * Query the score history of a specific member
  *
  * <b>Request Type: </b>GET<br/>
  * <b>Request Endpoint: </b>http://{server-domain}/api/scores?memberId={memberId}&per-page={pageSize}&page={pageNum}
  * <b>Summary: </b>This api is for query the score history for a specific member
  *
  * <b>Response Example: </b>
  * <pre>
  * {
  * "items": [
  *   {
  *       "id": "54aa2e1fdb4c0ec6048b4570",
  *       "assigner": "admin",
  *       "increment": 100,
  *       "description": "abc123",
  *       "createdAt": "2015-01-05 14:24:31"
  *   },
  *   {
  *       "id": "54aa2df3db4c0ec5048b4570",
  *       "assigner": "admin",
  *       "increment": 100,
  *       "description": "",
  *       "createdAt": "2015-01-05 14:23:47"
  *   }
  * ],
  * "_links": {
  *   "self": {
  *       "href": "http://dev.cp.augmarketing.cn/api/member/scores?memberId=54a8f557ff64ee5203bede18&page=1"
  *   }
  * },
  * "_meta": {
  *   "totalCount": 12,
  *   "pageCount": 1,
  *  "currentPage": 1,
  *   "perPage": 20
  * }
  *}
  * </pre>
  */
 public function actionIndex()
 {
     $params = $this->getQuery();
     if (!empty($params['memberId'])) {
         $params['memberId'] = new MongoId($params['memberId']);
     }
     $accountId = $this->getAccountId();
     //build the query
     return ScoreHistory::search($params, $accountId);
 }