public function search($params) { $query = Locality::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $query->andFilterWhere([Locality::tableName() . '.status' => '1']); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['Id' => $this->Id, 'cityId' => $this->cityId, 'zoneId' => $this->zoneId, 'createdOn' => $this->createdOn, 'status' => $this->status, 'isFg' => $this->isFg, 'gpsLat' => $this->gpsLat, 'gpsLong' => $this->gpsLong, 'pin' => $this->pin, 'updatedOn' => $this->updatedOn, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'alias', $this->alias])->andFilterWhere(['like', 'nearBy', $this->nearBy])->andFilterWhere(['like', 'ip', $this->ip]); return $dataProvider; }