feat(api): /api/customers 加 friend_id 筛选(用于查单个客户昵称)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-15 10:54:22 +08:00
parent 661ecfc8c9
commit 1f89eeddb0
+3
View File
@@ -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: