search by position_id

This commit is contained in:
andrey 2021-08-12 12:34:37 +03:00
parent 93f7d4496c
commit d7fd9b3c9b

View File

@ -20,12 +20,13 @@ class ProfileSearchForm extends Model
public $limit = 10;
public $offset = 0;
public $skills;
public $position_id;
public $id;
public function rules()
{
return [
[['id', 'limit', 'offset'], 'safe'],
[['id', 'limit', 'offset', 'position_id'], 'safe'],
[['skills'], 'checkIsArray'],
];
}
@ -53,7 +54,7 @@ class ProfileSearchForm extends Model
public function byParams()
{
$model = UserCard::find();
$model = UserCard::find()->select('user_card.id');
if($this->skills){
@ -66,6 +67,8 @@ class ProfileSearchForm extends Model
$model->joinWith('skillValues');
}
$model->andFilterWhere(['position_id' => $this->position_id]);
$model->andWhere(['status' => [4, 12]]);
$model->andWhere(['deleted_at' => null]);