user card search fix 3
This commit is contained in:
parent
48463110bd
commit
c5850bda46
@ -52,14 +52,16 @@ 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]);
|
||||||
}
|
}
|
||||||
$employeeIdList = ManagerEmployee::find()
|
else {
|
||||||
->where(['manager_id' => $manager->id])
|
$employeeIdList = ManagerEmployee::find()
|
||||||
->select('employee_id')
|
->where(['manager_id' => $manager->id])
|
||||||
->column();
|
->select('employee_id')
|
||||||
|
->column();
|
||||||
|
|
||||||
$query = UserCard::find()->where(['in', 'user_card.id', $employeeIdList]);
|
$query = UserCard::find()->where(['in', 'user_card.id', $employeeIdList]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$query->distinct()
|
$query->distinct()
|
||||||
|
Loading…
Reference in New Issue
Block a user