feat(api): /api/customers 加 friend_id 筛选(用于查单个客户昵称)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,7 @@ async def list_customers(
|
|||||||
channel: Annotated[str | None, Query()] = None,
|
channel: Annotated[str | None, Query()] = None,
|
||||||
department_id: Annotated[str | None, Query()] = None,
|
department_id: Annotated[str | None, Query()] = None,
|
||||||
owner_account_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,
|
user_id: Annotated[str | None, Query()] = None,
|
||||||
add_time_since: Annotated[int | None, Query(ge=0)] = None,
|
add_time_since: Annotated[int | None, Query(ge=0)] = None,
|
||||||
last_chat_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
|
Staff.dept_id == department_id
|
||||||
)
|
)
|
||||||
conditions.append(Customer.user_id.in_(dept_user_ids))
|
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:
|
if user_id is not None:
|
||||||
conditions.append(Customer.user_id == user_id)
|
conditions.append(Customer.user_id == user_id)
|
||||||
if add_time_since is not None:
|
if add_time_since is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user