コード例 #1
0
ファイル: MeetingSearch.php プロジェクト: antastic/meetingsrp
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Meeting::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, 'date_start' => $this->date_start, 'date_end' => $this->date_end, 'create_at' => $this->create_at, 'update_at' => $this->update_at, 'room_id' => $this->room_id, 'user_id' => $this->user_id]);
     $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'descition', $this->descition])->andFilterWhere(['like', 'optional', $this->optional])->andFilterWhere(['like', 'status', $this->status]);
     return $dataProvider;
 }