|
@@ -1129,10 +1129,10 @@ def get_photo_records(page: int = 1, size: int = 5, goods_art_no: str = None):
|
|
|
|
|
|
|
|
# 查询所有不重复的货号及对应的最大时间,进行分页
|
|
# 查询所有不重复的货号及对应的最大时间,进行分页
|
|
|
base_statement = (
|
|
base_statement = (
|
|
|
- select(PhotoRecord.goods_art_no, func.max(PhotoRecord.id).label('max_id'))
|
|
|
|
|
|
|
+ select(PhotoRecord.goods_art_no, func.max(PhotoRecord.id).label("max_id"))
|
|
|
.where(*base_conditions)
|
|
.where(*base_conditions)
|
|
|
.group_by(PhotoRecord.goods_art_no)
|
|
.group_by(PhotoRecord.goods_art_no)
|
|
|
- .order_by(desc('max_id'))
|
|
|
|
|
|
|
+ .order_by(desc("max_id"))
|
|
|
.offset((page - 1) * size)
|
|
.offset((page - 1) * size)
|
|
|
.limit(size)
|
|
.limit(size)
|
|
|
)
|
|
)
|