public function searchGradeOne($params) { $query = GradeOneForm::find(); $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, 'grade_protection' => $this->grade_protection, 'enrolled_id' => $this->enrolled_id, 'grading_period' => $this->grading_period, 'core_value_1' => $this->core_value_1, 'core_value_2' => $this->core_value_2, 'core_value_3' => $this->core_value_3, 'core_value_4' => $this->core_value_4, 'subject_1' => $this->subject_1, 'subject_2' => $this->subject_2, 'subject_3' => $this->subject_3, 'subject_4' => $this->subject_4, 'subject_5' => $this->subject_5, 'subject_6' => $this->subject_6, 'subject_7' => $this->subject_7, 'subject_8' => $this->subject_8])->groupBy('enrolled_id'); return $dataProvider; }
protected function findGrade($eid) { if (($model = GradeOneForm::find()->where(['enrolled_id' => $eid])->all()) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }