예제 #1
0
 public function actionGetFaqs()
 {
     FaqCategory::$isFetchFaqs = true;
     $accountId = Yii::$app->request->get('accountId');
     $categoryName = Yii::$app->request->get('category');
     $categoryName = urldecode($categoryName);
     if (empty($accountId)) {
         throw new ServerErrorHttpException('Invalid parameters!');
     }
     $accountId = new \MongoId($accountId);
     if (!empty($categoryName)) {
         $category = FaqCategory::getByName($categoryName, $accountId);
         return $category;
     }
     return FaqCategory::getAll($accountId);
 }