From 8c2cfcb37be0fad4257cfe7ceba2bb53ed15344a Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 11 Jul 2023 11:53:15 +0800 Subject: [PATCH] fix --- model/gmodel/fs_product_template_v2_logic.go | 8 -------- server/product/internal/logic/otherproductlistlogic.go | 3 --- 2 files changed, 11 deletions(-) diff --git a/model/gmodel/fs_product_template_v2_logic.go b/model/gmodel/fs_product_template_v2_logic.go index 81b53bf7..40a48c81 100755 --- a/model/gmodel/fs_product_template_v2_logic.go +++ b/model/gmodel/fs_product_template_v2_logic.go @@ -78,8 +78,6 @@ type GetProductTemplateListByParamsReq struct { GroupBy string OrderBy string Fields string - SortNeq *int64 - TitleKeyword string Status *int64 } func (t *FsProductTemplateV2Model) GetProductTemplateListByParams(ctx context.Context, req GetProductTemplateListByParamsReq) (resp []FsProductTemplateV2, err error) { @@ -96,12 +94,6 @@ func (t *FsProductTemplateV2Model) GetProductTemplateListByParams(ctx context.Co if req.Fields != ""{ db = db.Select(req.Fields) } - if req.SortNeq != nil{ - db = db.Where("`sort` != ?",req.SortNeq) - } - if req.TitleKeyword != ""{ - db = db.Where("title like ?",`%`+req.TitleKeyword+`%`) - } if req.Status != nil{ db = db.Where("`status` = ?",req.Status) } diff --git a/server/product/internal/logic/otherproductlistlogic.go b/server/product/internal/logic/otherproductlistlogic.go index a4069d57..592a79b1 100644 --- a/server/product/internal/logic/otherproductlistlogic.go +++ b/server/product/internal/logic/otherproductlistlogic.go @@ -114,15 +114,12 @@ func (l *OtherProductListLogic) getRandom(productIds []int64,limit int)(result [ mapProduct[v.Id] = k } //查询最新的sku - sortNeq := int64(0) reqStatus := int64(1) productTemplateIds,err := l.svcCtx.AllModels.FsProductTemplateV2.GetProductTemplateListByParams(l.ctx,gmodel.GetProductTemplateListByParamsReq{ ProductIds: newProductIds, GroupBy: "product_id", OrderBy: "id DESC,sort DESC", Fields: "product_id,max(id) as id", - SortNeq: &sortNeq, - TitleKeyword: "A007", Status: &reqStatus, }) if err != nil{