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,14 +52,16 @@ class UserCardSearch extends UserCard
} else {
$manager = Manager::findOne(Yii::$app->user->id);
if (!$manager){
return false;
$query = UserCard::find()->where(['id' => 0]);
}
$employeeIdList = ManagerEmployee::find()
->where(['manager_id' => $manager->id])
->select('employee_id')
->column();
else {
$employeeIdList = ManagerEmployee::find()
->where(['manager_id' => $manager->id])
->select('employee_id')
->column();
$query = UserCard::find()->where(['in', 'user_card.id', $employeeIdList]);
$query = UserCard::find()->where(['in', 'user_card.id', $employeeIdList]);
}
}
$query->distinct()