Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = AssignmentBook::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, 'chooserId' => $this->chooserId, 'subjectId' => $this->subjectId, 'date' => $this->date, 'taskAssignmentDate' => $this->taskAssignmentDate, 'taskStartData' => $this->taskStartData, 'taskEndData' => $this->taskEndData]);
     $query->andFilterWhere(['like', 'topicType', $this->topicType])->andFilterWhere(['like', 'paperContent', $this->paperContent])->andFilterWhere(['like', 'paperRequireAndData', $this->paperRequireAndData])->andFilterWhere(['like', 'paperPreliminaryWork', $this->paperPreliminaryWork])->andFilterWhere(['like', 'referenceDocumentation', $this->referenceDocumentation])->andFilterWhere(['like', 'equipment', $this->equipment])->andFilterWhere(['like', 'enterpriseOrGoup', $this->enterpriseOrGoup])->andFilterWhere(['like', 'chiefOpnion', $this->chiefOpnion])->andFilterWhere(['like', 'acadmyGroupOpnion', $this->acadmyGroupOpnion])->andFilterWhere(['like', 'pdfExist', $this->pdfExist])->andFilterWhere(['like', 'route', $this->route]);
     return $dataProvider;
 }
 protected function findAssignmentBook($chooserid)
 {
     if (($model = AssignmentBook::find()->where(['chooserId' => $chooserid])->one()) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }