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

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

1 parent 73d52829
......@@ -4,12 +4,12 @@ namespace app\models;
use yii\base\Model;
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}
......@@ -17,9 +17,8 @@ class PlantSearch extends Plant
public function rules()
{
return [
[['id', 'bush_type', 'flower_form', 'flower_tint', 'cost', 'top', 'active'], 'integer'],
[['title', 'description', 'created_at', 'edit_at'], 'safe'],
[['height'], 'number'],
[['id', 'wis_status', 'tix'], 'integer'],
[['domain', 'created_at', 'csv_date', 'wis_date','wis_status'], 'safe'],
];
}
......@@ -41,7 +40,7 @@ class PlantSearch extends Plant
*/
public function search($params)
{
$query = Plant::find();
$query = Host::find();
// add conditions that should always apply here
......@@ -60,19 +59,14 @@ class PlantSearch extends Plant
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'height' => $this->height,
'bush_type' => $this->bush_type,
'flower_form' => $this->flower_form,
'flower_tint' => $this->flower_tint,
'created_at' => $this->created_at,
'cost' => $this->cost,
'top' => $this->top,
'active' => $this->active,
'edit_at' => $this->edit_at,
//'created_at' => $this->created_at,
//'csv_date' => $this->csv_date,
//'wis_date' => $this->wis_date,
'wis_status' => $this->wis_status,
'tix' => $this->tix,
]);
$query->andFilterWhere(['like', 'title', $this->title])
->andFilterWhere(['like', 'description', $this->description]);
$query->andFilterWhere(['like', 'domain', $this->domain]);
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!