diff --git a/backend/internal/handler/stock_in.go b/backend/internal/handler/stock_in.go index 0fe438b..4018a53 100644 --- a/backend/internal/handler/stock_in.go +++ b/backend/internal/handler/stock_in.go @@ -75,7 +75,9 @@ func (h *StockInHandler) List(c *gin.Context) { query.Count(&total) orders := make([]model.StockInOrder, 0) - query.Preload("Warehouse", "shop_id = ?", shopID). + // 列表卡片需要 items.length 显示品项数(手机端 MCard sub 行) + query.Preload("Items"). + Preload("Warehouse", "shop_id = ?", shopID). Preload("Partner", "shop_id = ?", shopID). Preload("Operator", "shop_id = ?", shopID). Preload("Reviewer", "shop_id = ?", shopID). diff --git a/backend/internal/handler/stock_out.go b/backend/internal/handler/stock_out.go index 6c9a81d..c5d72c7 100644 --- a/backend/internal/handler/stock_out.go +++ b/backend/internal/handler/stock_out.go @@ -87,7 +87,9 @@ func (h *StockOutHandler) List(c *gin.Context) { query.Count(&total) orders := make([]model.StockOutOrder, 0) - query.Preload("Warehouse", "shop_id = ?", shopID). + // 列表卡片需要 items.length 显示品项数(手机端 MCard sub 行) + query.Preload("Items"). + Preload("Warehouse", "shop_id = ?", shopID). Preload("Partner", "shop_id = ?", shopID). Preload("Operator", "shop_id = ?", shopID). Preload("Reviewer", "shop_id = ?", shopID).