/** 咨询与建议 */ public function actionConsult() { $user = Yii::$app->session->get('user'); $consultForm = new ConsultForm(); if ($consultForm->load(Yii::$app->request->post()) && $consultForm->validate()) { $consultForm->record(); CommonFunctions::createAlertMessage("已经记录您的咨询或建议,我们将尽快给您答复", "success"); } else { CommonFunctions::createAlertMessage("请填写相关咨询的内容或者对我们的建议,我们会在第一时间回复您!", "info"); } $ownerServices = Service::findByUser($user['userId'], 5); $publishServices = Service::findPublished(5); return $this->render('consult', ['consultForm' => $consultForm, 'ownerServices' => $ownerServices, 'publishServices' => $publishServices]); }