diff --git a/backend/internal/handler/merchant.go b/backend/internal/handler/merchant.go index a586c4c..74685d0 100644 --- a/backend/internal/handler/merchant.go +++ b/backend/internal/handler/merchant.go @@ -57,9 +57,8 @@ func mapKeys(values map[string]struct{}) []string { func (h *MerchantHandler) ListProducts(c *gin.Context) { page, size := pageParams(c) list, total, err := h.merchantSvc.ListMerchantProductsWithOptions(middleware.GetMerchantID(c), page, size, service.ListMerchantProductsOptions{ - Status: strings.TrimSpace(c.Query("status")), - Keyword: strings.TrimSpace(c.Query("keyword")), - ExcludeLegacyLewanSKU: true, // LEWAN_* 镜像已废弃,列表永不返回 + Status: strings.TrimSpace(c.Query("status")), + Keyword: strings.TrimSpace(c.Query("keyword")), }) if err != nil { if err.Error() == "无效的商品状态" { diff --git a/backend/internal/service/merchant_product.go b/backend/internal/service/merchant_product.go index 080f8e7..44c66b8 100644 --- a/backend/internal/service/merchant_product.go +++ b/backend/internal/service/merchant_product.go @@ -84,10 +84,9 @@ func (s *MerchantService) CreateMerchantProduct(merchantID uint, in CreateMercha } type ListMerchantProductsOptions struct { - ActiveOnly bool - ExcludeLegacyLewanSKU bool - Status string // active / inactive;空表示不限(ActiveOnly 优先) - Keyword string + ActiveOnly bool + Status string // active / inactive;空表示不限(ActiveOnly 优先) + Keyword string } func (s *MerchantService) ListMerchantProducts(merchantID uint, page, size int, activeOnly bool) ([]model.MerchantProduct, int64, error) { @@ -96,11 +95,10 @@ func (s *MerchantService) ListMerchantProducts(merchantID uint, page, size int, }) } -// ListMerchantProductsForClient 商户开放 API / 手工下单选品:排除 LEWAN_* 镜像,只返回英文主 sku。 +// ListMerchantProductsForClient 商户开放 API / 手工下单选品:只返回在售英文主 sku。 func (s *MerchantService) ListMerchantProductsForClient(merchantID uint, page, size int) ([]model.MerchantProduct, int64, error) { return s.ListMerchantProductsWithOptions(merchantID, page, size, ListMerchantProductsOptions{ - ActiveOnly: true, - ExcludeLegacyLewanSKU: true, + ActiveOnly: true, }) } @@ -116,9 +114,6 @@ func (s *MerchantService) ListMerchantProductsWithOptions(merchantID uint, page, } tx = tx.Where("status = ?", status) } - if opts.ExcludeLegacyLewanSKU { - tx = tx.Where("sku NOT ILIKE ?", "lewan_%") - } if keyword := strings.TrimSpace(opts.Keyword); keyword != "" { like := "%" + keyword + "%" tx = tx.Where("(sku ILIKE ? OR display_name ILIKE ?)", like, like) diff --git a/frontend/src/pages/PlatformProducts.tsx b/frontend/src/pages/PlatformProducts.tsx index ca9421e..307b080 100644 --- a/frontend/src/pages/PlatformProducts.tsx +++ b/frontend/src/pages/PlatformProducts.tsx @@ -879,9 +879,9 @@ export default function PlatformProducts() {