Quellcode durchsuchen

```
fix(api): 修复照片记录查询的排序逻辑

将照片记录查询中的ID排序从倒序改为正序,以确保按货号分组时数据的正确顺序。
之前使用desc("id")导致数据排序不符合预期,现在改为asc("id")实现正确的排序逻辑。
```

rambo vor 1 Monat
Ursprung
Commit
51a05b948c
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      python/api.py

+ 1 - 1
python/api.py

@@ -1120,7 +1120,7 @@ def get_photo_records(page: int = 1, size: int = 5):
             .join(DeviceConfig, PhotoRecord.action_id == DeviceConfig.id)
             .join(DeviceConfig, PhotoRecord.action_id == DeviceConfig.id)
             .where(PhotoRecord.goods_art_no.in_(current_goods_art_nos))
             .where(PhotoRecord.goods_art_no.in_(current_goods_art_nos))
             .where(PhotoRecord.delete_time == None)
             .where(PhotoRecord.delete_time == None)
-            .order_by(PhotoRecord.goods_art_no, desc("id"))  # 按货号分组并按ID倒序
+            .order_by(PhotoRecord.goods_art_no, asc("id"))  # 按货号分组并按ID倒序
         )
         )
         all_items = session.exec(query).mappings().all()
         all_items = session.exec(query).mappings().all()