diff --git a/common/models/Team.php b/common/models/Team.php index becbdef..2e6343c 100644 --- a/common/models/Team.php +++ b/common/models/Team.php @@ -103,11 +103,6 @@ 'max' => 255, ], [ - ['experience_from'], - 'default', - 'value' => date('Y'), - ], - [ ['link'], 'default', 'value' => '', diff --git a/common/models/TeamSearch.php b/common/models/TeamSearch.php index 6d480d1..90d61a9 100644 --- a/common/models/TeamSearch.php +++ b/common/models/TeamSearch.php @@ -41,16 +41,10 @@ [ [ 'experience_from_from', - ], - 'default', - 'value' => 0, - ], - [ - [ 'experience_from_to', ], - 'default', - 'value' => 100, + 'integer', + 'min' => 0, ], [ [ @@ -160,12 +154,14 @@ 'user_add_id' => $this->user_add_id, ]); - $query->andFilterWhere([ - 'between', - 'experience_from', - $this->experience_from_to ? ( date('Y') - $this->experience_from_to ) : ( date('Y') - 100 ), - $this->experience_from_from ? ( date('Y') - $this->experience_from_from ) : date('Y'), - ]); + if(!empty($this->experience_from_to) || !empty($this->experience_from_from)) { + $query->andFilterWhere([ + 'between', + 'experience_from', + $this->experience_from_to ? ( date('Y') - $this->experience_from_to ) : ( date('Y') - 100 ), + $this->experience_from_from ? ( date('Y') - $this->experience_from_from ) : date('Y'), + ]); + } if(!empty( $this->link ) || $this->link === '0') { $query->andFilterWhere([ diff --git a/common/widgets/views/phone_field.php b/common/widgets/views/phone_field.php index 09922d4..4f70a07 100644 --- a/common/widgets/views/phone_field.php +++ b/common/widgets/views/phone_field.php @@ -1,5 +1,7 @@