/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Evidence::find(); //$query->joinWith(['studentEvidences']); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'accepted_date' => $this->accepted_date, 'updated_at' => $this->updated_at]); $query->andFilterWhere(['like', 'attachment_path', $this->attachment_path])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'status', $this->status]); return $dataProvider; }
/** * Shows feedback screen for the selected task * @param $taskId * @param $evidenceId * @return string * @throws NotFoundHttpException */ public function actionShowFeedbackScreen($taskId, $evidenceId) { return $this->render('feedback', ['model' => $this->findModel($taskId), 'evidence' => Evidence::find()->where("id=" . $evidenceId)->one()]); }