fix
This commit is contained in:
parent
dea09094b7
commit
8c2cfcb37b
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue
Block a user