Skip to content

Commit

Permalink
agent id filter added
Browse files Browse the repository at this point in the history
  • Loading branch information
hafijul233 committed Sep 24, 2024
1 parent 30f7481 commit ffbafd1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Repositories/Eloquent/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ public function list(array $filters = [])
$query->where($this->model->getKeyName(), '=', $filters['user_id']);
}

if (!empty($filters['parent_id'])) {
$query->where('parent_id', '=', $filters['parent_id']);
}

if (!empty($filters['agent_id'])) {
$query->where(function ($query) use ($filters) {
return $query->where('parent_id', '=', $filters['agent_id'])
->orWhere($this->model->getKeyName(), '=', $filters['agent_id']);
});
}

if (!empty($filters['email'])) {
$query->where('email', '=', $filters['email']);
}
Expand Down

0 comments on commit ffbafd1

Please sign in to comment.