fix
This commit is contained in:
parent
dea09094b7
commit
8c2cfcb37b
|
@ -78,8 +78,6 @@ type GetProductTemplateListByParamsReq struct {
|
||||||
GroupBy string
|
GroupBy string
|
||||||
OrderBy string
|
OrderBy string
|
||||||
Fields string
|
Fields string
|
||||||
SortNeq *int64
|
|
||||||
TitleKeyword string
|
|
||||||
Status *int64
|
Status *int64
|
||||||
}
|
}
|
||||||
func (t *FsProductTemplateV2Model) GetProductTemplateListByParams(ctx context.Context, req GetProductTemplateListByParamsReq) (resp []FsProductTemplateV2, err error) {
|
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 != ""{
|
if req.Fields != ""{
|
||||||
db = db.Select(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{
|
if req.Status != nil{
|
||||||
db = db.Where("`status` = ?",req.Status)
|
db = db.Where("`status` = ?",req.Status)
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,15 +114,12 @@ func (l *OtherProductListLogic) getRandom(productIds []int64,limit int)(result [
|
||||||
mapProduct[v.Id] = k
|
mapProduct[v.Id] = k
|
||||||
}
|
}
|
||||||
//查询最新的sku
|
//查询最新的sku
|
||||||
sortNeq := int64(0)
|
|
||||||
reqStatus := int64(1)
|
reqStatus := int64(1)
|
||||||
productTemplateIds,err := l.svcCtx.AllModels.FsProductTemplateV2.GetProductTemplateListByParams(l.ctx,gmodel.GetProductTemplateListByParamsReq{
|
productTemplateIds,err := l.svcCtx.AllModels.FsProductTemplateV2.GetProductTemplateListByParams(l.ctx,gmodel.GetProductTemplateListByParamsReq{
|
||||||
ProductIds: newProductIds,
|
ProductIds: newProductIds,
|
||||||
GroupBy: "product_id",
|
GroupBy: "product_id",
|
||||||
OrderBy: "id DESC,sort DESC",
|
OrderBy: "id DESC,sort DESC",
|
||||||
Fields: "product_id,max(id) as id",
|
Fields: "product_id,max(id) as id",
|
||||||
SortNeq: &sortNeq,
|
|
||||||
TitleKeyword: "A007",
|
|
||||||
Status: &reqStatus,
|
Status: &reqStatus,
|
||||||
})
|
})
|
||||||
if err != nil{
|
if err != nil{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user