From 9911ad97653fcab336ef64c75e6e518126170ae4 Mon Sep 17 00:00:00 2001 From: howell <2827207845@qq.com> Date: Fri, 1 Apr 2022 17:46:25 +0800 Subject: [PATCH] fix: sale_publish --- internal/api/manage/goods/query.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/internal/api/manage/goods/query.go b/internal/api/manage/goods/query.go index 697fe23..b5b6b9b 100755 --- a/internal/api/manage/goods/query.go +++ b/internal/api/manage/goods/query.go @@ -127,11 +127,20 @@ func QueryGoodsList(c *gin.Context) { } where2 := "" - if p.Type == 1 { - where2 = "publish_status = 1" - } else if p.Type == 2 { - where2 = "publish_status = 0" + if p.IsSale { + if p.Type == 1 { + where2 = "sale_publish = 1" + } else if p.Type == 2 { + where2 = "sale_publish = 0" + } + } else { + if p.Type == 1 { + where2 = "publish_status = 1" + } else if p.Type == 2 { + where2 = "publish_status = 0" + } } + where3 := "" if len(p.Sku) > 0 { var skuInfo goods.Sku