diff --git a/yunke-server/app/api/routers/customer.py b/yunke-server/app/api/routers/customer.py index 37a6725..6d42e55 100644 --- a/yunke-server/app/api/routers/customer.py +++ b/yunke-server/app/api/routers/customer.py @@ -35,6 +35,7 @@ async def list_customers( channel: Annotated[str | None, Query()] = None, department_id: Annotated[str | None, Query()] = None, owner_account_id: Annotated[str | None, Query()] = None, + friend_id: Annotated[str | None, Query()] = None, user_id: Annotated[str | None, Query()] = None, add_time_since: Annotated[int | None, Query(ge=0)] = None, last_chat_since: Annotated[int | None, Query(ge=0)] = None, @@ -51,6 +52,8 @@ async def list_customers( Staff.dept_id == department_id ) conditions.append(Customer.user_id.in_(dept_user_ids)) + if friend_id is not None: + conditions.append(Customer.friend_id == friend_id) if user_id is not None: conditions.append(Customer.user_id == user_id) if add_time_since is not None: