user card search fix 2
This commit is contained in:
parent
7852fa4fc1
commit
48463110bd
@ -43,16 +43,16 @@ class UserCardSearch extends UserCard
|
|||||||
*
|
*
|
||||||
* @param array $params
|
* @param array $params
|
||||||
*
|
*
|
||||||
* @return ActiveDataProvider
|
* @return ActiveDataProvider | bool
|
||||||
*/
|
*/
|
||||||
public function search($params): ActiveDataProvider
|
public function search($params)
|
||||||
{
|
{
|
||||||
if (Yii::$app->user->can('show_all_profiles')) {
|
if (Yii::$app->user->can('show_all_profiles')) {
|
||||||
$query = UserCard::find();
|
$query = UserCard::find();
|
||||||
} else {
|
} else {
|
||||||
$manager = Manager::findOne(Yii::$app->user->id);
|
$manager = Manager::findOne(Yii::$app->user->id);
|
||||||
if (!$manager){
|
if (!$manager){
|
||||||
return new ActiveDataProvider();
|
return false;
|
||||||
}
|
}
|
||||||
$employeeIdList = ManagerEmployee::find()
|
$employeeIdList = ManagerEmployee::find()
|
||||||
->where(['manager_id' => $manager->id])
|
->where(['manager_id' => $manager->id])
|
||||||
|
Loading…
Reference in New Issue
Block a user