hotfix: func→sa_func 解决局部变量遮蔽
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
import uuid
|
import uuid
|
||||||
from fastapi import HTTPException, status
|
from fastapi import HTTPException, status
|
||||||
from sqlalchemy import select, or_, cast, String, delete, update, func
|
from sqlalchemy import select, or_, cast, String, delete, update
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
from sqlalchemy.orm import selectinload
|
from sqlalchemy.orm import selectinload
|
||||||
|
|
||||||
@ -473,7 +473,7 @@ async def get_all_products(
|
|||||||
).subquery()
|
).subquery()
|
||||||
ranked = (
|
ranked = (
|
||||||
select(TR.task_id, TR.remark, TR.created_at, Task.product_id,
|
select(TR.task_id, TR.remark, TR.created_at, Task.product_id,
|
||||||
func.row_number().over(
|
sa_func.row_number().over(
|
||||||
partition_by=Task.product_id,
|
partition_by=Task.product_id,
|
||||||
order_by=TR.created_at.desc()
|
order_by=TR.created_at.desc()
|
||||||
).label("rn"))
|
).label("rn"))
|
||||||
|
|||||||
Reference in New Issue
Block a user