Commit 2659413c by Скуратович Александр

добавмил модельку HostSearch

1 parent 73d52829
...@@ -4,12 +4,12 @@ namespace app\models; ...@@ -4,12 +4,12 @@ namespace app\models;
use yii\base\Model; use yii\base\Model;
use yii\data\ActiveDataProvider; use yii\data\ActiveDataProvider;
use app\models\Plant; use app\models\Host;
/** /**
* PlantSearch represents the model behind the search form of `app\models\Plant`. * HostSearch represents the model behind the search form of `app\models\Host`.
*/ */
class PlantSearch extends Plant class HostSearch extends Host
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
...@@ -17,9 +17,8 @@ class PlantSearch extends Plant ...@@ -17,9 +17,8 @@ class PlantSearch extends Plant
public function rules() public function rules()
{ {
return [ return [
[['id', 'bush_type', 'flower_form', 'flower_tint', 'cost', 'top', 'active'], 'integer'], [['id', 'wis_status', 'tix'], 'integer'],
[['title', 'description', 'created_at', 'edit_at'], 'safe'], [['domain', 'created_at', 'csv_date', 'wis_date','wis_status'], 'safe'],
[['height'], 'number'],
]; ];
} }
...@@ -41,7 +40,7 @@ class PlantSearch extends Plant ...@@ -41,7 +40,7 @@ class PlantSearch extends Plant
*/ */
public function search($params) public function search($params)
{ {
$query = Plant::find(); $query = Host::find();
// add conditions that should always apply here // add conditions that should always apply here
...@@ -60,19 +59,14 @@ class PlantSearch extends Plant ...@@ -60,19 +59,14 @@ class PlantSearch extends Plant
// grid filtering conditions // grid filtering conditions
$query->andFilterWhere([ $query->andFilterWhere([
'id' => $this->id, 'id' => $this->id,
'height' => $this->height, //'created_at' => $this->created_at,
'bush_type' => $this->bush_type, //'csv_date' => $this->csv_date,
'flower_form' => $this->flower_form, //'wis_date' => $this->wis_date,
'flower_tint' => $this->flower_tint, 'wis_status' => $this->wis_status,
'created_at' => $this->created_at, 'tix' => $this->tix,
'cost' => $this->cost,
'top' => $this->top,
'active' => $this->active,
'edit_at' => $this->edit_at,
]); ]);
$query->andFilterWhere(['like', 'title', $this->title]) $query->andFilterWhere(['like', 'domain', $this->domain]);
->andFilterWhere(['like', 'description', $this->description]);
return $dataProvider; return $dataProvider;
} }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!