This commit is contained in:
2026-07-03 10:57:14 +08:00
parent 4992191da9
commit 61d74fcc04
4 changed files with 33 additions and 9 deletions
@@ -28,7 +28,16 @@ async def list_user_oauth_apps(
if app_id is not None:
query = query.where(UserOAuthApp.app_id.like(f"%{app_id}%"))
total_result = await db.execute(select(func.count(UserOAuthApp.id)).where(UserOAuthApp.deleted_at.is_(None)))
count_query = select(func.count(UserOAuthApp.id)).where(UserOAuthApp.deleted_at.is_(None))
if open_type is not None:
count_query = count_query.where(UserOAuthApp.open_type == open_type)
if status is not None:
count_query = count_query.where(UserOAuthApp.status == status)
if create_by is not None:
count_query = count_query.where(UserOAuthApp.create_by == create_by)
if app_id is not None:
count_query = count_query.where(UserOAuthApp.app_id.like(f"%{app_id}%"))
total_result = await db.execute(count_query)
total = total_result.scalar() or 0
result = await db.execute(query.offset((page - 1) * page_size).limit(page_size))