diff --git a/model/gmodel/fs_product_logic.go b/model/gmodel/fs_product_logic.go index 565395d7..12617ca3 100755 --- a/model/gmodel/fs_product_logic.go +++ b/model/gmodel/fs_product_logic.go @@ -88,10 +88,10 @@ func (p *FsProductModel) GetRandomProductList(ctx context.Context, limit int) (r Where("`is_del` =? and `is_shelf` = ?", 0, 1).Order("RAND()").Limit(limit).Find(&resp).Error return resp, err } -func (p *FsProductModel) GetIgnoreRandomProductList(ctx context.Context, limit int, notInProductIds []int64) (resp []FsProduct, err error) { +func (p *FsProductModel) GetIgnoreRandomProductList(ctx context.Context, notEqType int64, limit int, notInProductIds []int64) (resp []FsProduct, err error) { db := p.db.WithContext(ctx).Model(&FsProduct{}). //过滤报价单产品 - Where("`is_del` =? and `is_shelf` = ? and `type` != ?", 0, 1, 39) + Where("`is_del` =? and `is_shelf` = ? and `type` != ?", 0, 1, notEqType) if len(notInProductIds) > 0 { db = db.Where("`id` not in(?)", notInProductIds) } diff --git a/server/product/internal/logic/getrecommendproductlistlogic.go b/server/product/internal/logic/getrecommendproductlistlogic.go index 072b9164..3b38ae6e 100644 --- a/server/product/internal/logic/getrecommendproductlistlogic.go +++ b/server/product/internal/logic/getrecommendproductlistlogic.go @@ -84,7 +84,8 @@ func (l *GetRecommendProductListLogic) GetRecommendProductList(req *types.GetRec lenRecommendProduct := len(recommendProductList) if lenRecommendProduct < int(req.Num) { appendNum := int(req.Num) - lenRecommendProduct - productList, err := l.svcCtx.AllModels.FsProduct.GetIgnoreRandomProductList(l.ctx, appendNum, ignoreProductIds) + //不要查报价单的 + productList, err := l.svcCtx.AllModels.FsProduct.GetIgnoreRandomProductList(l.ctx, 39, appendNum, ignoreProductIds) if err != nil { logx.Error(err) return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get product list")