public function search($params)
{
$query = Category::find();
$dataProvider = new ActiveDataProvider(['query' => $query]);
$dataProvider->setSort(['defaultOrder' => ['updatedOn' => SORT_DESC]]);
$query->andFilterWhere([Category::tableName() . '.status' => '1']);
if (!($this->load($params) && $this->validate())) {
return $dataProvider;
}
$query->andFilterWhere(['Id' => $this->Id, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy, 'createdOn' => $this->createdOn, 'updatedOn' => $this->updatedOn, 'status' => $this->status, 'parentId' => $this->parentId, 'is_fg' => $this->is_fg, 'is_event' => $this->is_event]);
$query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'ip', $this->ip]);
return $dataProvider;
}