rambo hace 2 semanas
padre
commit
1ecf58edf9
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      python/api.py

+ 2 - 2
python/api.py

@@ -1129,10 +1129,10 @@ def get_photo_records(page: int = 1, size: int = 5, goods_art_no: str = None):
 
     # 查询所有不重复的货号及对应的最大时间,进行分页
     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)
         .group_by(PhotoRecord.goods_art_no)
-        .order_by(desc('max_id'))
+        .order_by(desc("max_id"))
         .offset((page - 1) * size)
         .limit(size)
     )