Removed achievements from profile search form filters. Added doc for api/profile
This commit is contained in:
@ -20,7 +20,6 @@ class ProfileSearchForm extends Model
|
||||
public $limit = 10;
|
||||
public $offset = 0;
|
||||
public $skills;
|
||||
public $achievements;
|
||||
|
||||
public $position_id;
|
||||
public $id;
|
||||
@ -30,7 +29,6 @@ class ProfileSearchForm extends Model
|
||||
return [
|
||||
[['id', 'limit', 'offset', 'position_id'], 'safe'],
|
||||
[['skills'], 'checkIsArray'],
|
||||
[['achievements'], 'checkIsArray'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -71,20 +69,12 @@ class ProfileSearchForm extends Model
|
||||
$model->joinWith('skillValues');
|
||||
}
|
||||
|
||||
if($this->achievements){
|
||||
$model->joinWith(['achievements']);
|
||||
$this->achievements = explode(',', $this->achievements);
|
||||
$model->where(['achievement_user_card.achievement_id' => $this->achievements]);
|
||||
$model->having('COUNT(DISTINCT achievement_id) = ' . count($this->achievements));
|
||||
}
|
||||
else{
|
||||
$model->joinWith('achievements');
|
||||
}
|
||||
$model->joinWith('achievements');
|
||||
|
||||
$model->andFilterWhere(['position_id' => $this->position_id]);
|
||||
|
||||
$model->andWhere(['status' => [4, 12]]);
|
||||
$model->andWhere(['deleted_at' => null]);
|
||||
// $model->andFilterWhere(['position_id' => $this->position_id]);
|
||||
//
|
||||
// $model->andWhere(['status' => [4, 12]]);
|
||||
// $model->andWhere(['deleted_at' => null]);
|
||||
|
||||
$model->groupBy('card_skill.card_id');
|
||||
|
||||
|
Reference in New Issue
Block a user