/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Score::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['idscore' => $this->idscore, 'type' => $this->type, 'iduser' => $this->iduser, 'value' => $this->value, 'idtodo' => $this->idtodo, 'idcomment' => $this->idcomment, 'cdate' => $this->cdate, 'mdate' => $this->mdate]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Score::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['scorecard_id' => $this->scorecard_id, 'hole_id' => $this->hole_id, 'score' => $this->score, 'putts' => $this->putts, 'penalty' => $this->penalty, 'sand' => $this->sand]); $query->andFilterWhere(['like', 'note', $this->note])->andFilterWhere(['like', 'drive', $this->drive])->andFilterWhere(['like', 'regulation', $this->regulation])->andFilterWhere(['like', 'approach', $this->approach])->andFilterWhere(['like', 'putt', $this->putt]); return $dataProvider; }