attributes = post_params(); $form->user = get_user(); return $this->asJson($form->index()); } /** * 列表 */ public function actionList() { $form = new QuestionTemplateListForm(); $form->attributes = get_params(); return $this->asJson($form->list()); } /** * 获取热门问答 */ public function actionHotList() { $form = new QuestionTemplateListForm(); $form->attributes = get_params(); return $this->asJson($form->hot_list()); } /** * 获取模版页列表 */ public function actionTemplateList($id = null) { $form = new QuestionTemplateListForm(); $form->attributes = get_params(); return $this->asJson($form->template_list()); } /** * 提问 */ public function actionQuestion() { $form = new QAndAForm(); $form->attributes = post_params(); $form->user = get_user(); return $this->asJson($form->save()); } public function actionQuestionList() { $form = new QuestionTemplateListForm(); $form->attributes = get_params(); $form->user = get_user(); return $this->asJson($form->question_list()); } public function actionDelQuestion() { $form = new QuestionTemplateListForm(); $id = post_params('id'); return $this->asJson($form->del_question($id)); } public function actionAddIntegral() { $form = new QuestionTemplateListForm(); return $this->asJson($form->add_integral()); } }