feat:新增投顾agent和nl2sqlagent
This commit is contained in:
@@ -29,6 +29,7 @@ async def list_ledger(
|
||||
user: SysUser,
|
||||
*,
|
||||
action: str | None = None,
|
||||
customer_id: int | None = None,
|
||||
keyword: str | None = None,
|
||||
start: datetime | None = None,
|
||||
end: datetime | None = None,
|
||||
@@ -37,7 +38,7 @@ async def list_ledger(
|
||||
) -> dict:
|
||||
repo = AuditLogRepo(db)
|
||||
items = await repo.list_by_advisor(
|
||||
user_id=user.id, action=action, keyword=keyword, start=start, end=end,
|
||||
user_id=user.id, action=action, customer_id=customer_id, keyword=keyword, start=start, end=end,
|
||||
limit=page_size, offset=(page - 1) * page_size,
|
||||
)
|
||||
total = await repo.count_by_advisor(
|
||||
@@ -62,6 +63,7 @@ async def export_ledger(
|
||||
user: SysUser,
|
||||
*,
|
||||
action: str | None = None,
|
||||
customer_id: int | None = None,
|
||||
keyword: str | None = None,
|
||||
start: datetime | None = None,
|
||||
end: datetime | None = None,
|
||||
@@ -69,7 +71,7 @@ async def export_ledger(
|
||||
"""导出本人审计台账为 CSV 文本(全量,不限分页大小,上限 10000 条)。"""
|
||||
repo = AuditLogRepo(db)
|
||||
items = await repo.list_by_advisor(
|
||||
user_id=user.id, action=action, keyword=keyword, start=start, end=end,
|
||||
user_id=user.id, action=action, customer_id=customer_id, keyword=keyword, start=start, end=end,
|
||||
limit=10000, offset=0,
|
||||
)
|
||||
return _to_csv([_audit_item(a) for a in items])
|
||||
|
||||
Reference in New Issue
Block a user