getUser()->id; $offset = intval($request->get('offset')); $maxSize = intval($request->get('maxSize')); $params = array( 'offset' => $offset, 'maxSize' => $maxSize, ); $result = $this->getService('Notification')->getList($userId, $params); return array( 'total' => $result['total'], 'list' => $result['collection']->toArray() ); } public function actionNotReadCount() { $userId = $this->getUser()->id; return $this->getService('Notification')->getNotReadCount($userId); } }