Pārlūkot izejas kodu

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

将PhotoRecord的排序方式从按goods_art_no和id改为按image_index排序,
以确保正确的显示顺序
```

rambo 9 stundas atpakaļ
vecāks
revīzija
4b49fb4813
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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):
             .outerjoin(DeviceConfig, PhotoRecord.action_id == DeviceConfig.id)
             .where(PhotoRecord.goods_art_no.in_(current_goods_art_nos))
             .where(PhotoRecord.delete_time == None)
-            .order_by(PhotoRecord.goods_art_no, asc("id"))  # 按货号分组并按ID倒序
+            .order_by(asc("image_index"))  # 按货号分组并按ID倒序
         )
         all_items = session.exec(query).mappings().all()