user card search fix 3

This commit is contained in:
Kavalar 2023-05-04 18:05:24 +03:00
parent 48463110bd
commit c5850bda46

View File

@ -52,8 +52,9 @@ class UserCardSearch extends UserCard
} else { } else {
$manager = Manager::findOne(Yii::$app->user->id); $manager = Manager::findOne(Yii::$app->user->id);
if (!$manager){ if (!$manager){
return false; $query = UserCard::find()->where(['id' => 0]);
} }
else {
$employeeIdList = ManagerEmployee::find() $employeeIdList = ManagerEmployee::find()
->where(['manager_id' => $manager->id]) ->where(['manager_id' => $manager->id])
->select('employee_id') ->select('employee_id')
@ -61,6 +62,7 @@ class UserCardSearch extends UserCard
$query = UserCard::find()->where(['in', 'user_card.id', $employeeIdList]); $query = UserCard::find()->where(['in', 'user_card.id', $employeeIdList]);
} }
}
$query->distinct() $query->distinct()
->leftJoin('card_skill', 'card_skill.card_id=user_card.id') ->leftJoin('card_skill', 'card_skill.card_id=user_card.id')