|
@ -26,8 +26,8 @@ class ExpressTemplateSearch extends ExpressTemplate |
|
|
public function rules() |
|
|
public function rules() |
|
|
{ |
|
|
{ |
|
|
return [ |
|
|
return [ |
|
|
[['id', 'calculation_type', 'basic_price', 'basic_count', 'extra_price', 'extra_count', 'updated_at', 'created_at'], 'integer'], |
|
|
|
|
|
[['name', 'province', 'city', 'area'], 'safe'], |
|
|
|
|
|
|
|
|
[['id', 'calculation_type', 'updated_at', 'created_at'], 'integer'], |
|
|
|
|
|
[['name'], 'safe'], |
|
|
['created_at_range','safe'], |
|
|
['created_at_range','safe'], |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
@ -122,18 +122,11 @@ class ExpressTemplateSearch extends ExpressTemplate |
|
|
$query->andFilterWhere([ |
|
|
$query->andFilterWhere([ |
|
|
'id' => $this->id, |
|
|
'id' => $this->id, |
|
|
'calculation_type' => $this->calculation_type, |
|
|
'calculation_type' => $this->calculation_type, |
|
|
'basic_price' => $this->basic_price, |
|
|
|
|
|
'basic_count' => $this->basic_count, |
|
|
|
|
|
'extra_price' => $this->extra_price, |
|
|
|
|
|
'extra_count' => $this->extra_count, |
|
|
|
|
|
'updated_at' => $this->updated_at, |
|
|
'updated_at' => $this->updated_at, |
|
|
'created_at' => $this->created_at, |
|
|
'created_at' => $this->created_at, |
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
$query->andFilterWhere(['like', 'name', $this->name]) |
|
|
|
|
|
->andFilterWhere(['like', 'province', $this->province]) |
|
|
|
|
|
->andFilterWhere(['like', 'city', $this->city]) |
|
|
|
|
|
->andFilterWhere(['like', 'area', $this->area]); |
|
|
|
|
|
|
|
|
$query->andFilterWhere(['like', 'name', $this->name]); |
|
|
if ($this->created_at_range) { |
|
|
if ($this->created_at_range) { |
|
|
$arr = explode(' ~ ', $this->created_at_range); |
|
|
$arr = explode(' ~ ', $this->created_at_range); |
|
|
$start = strtotime($arr[0]); |
|
|
$start = strtotime($arr[0]); |
|
|