fix
This commit is contained in:
parent
8e207ef600
commit
bb18b5effa
|
@ -74,17 +74,17 @@ func (t *FsProductTemplateV2Model) FindOneByModelId(ctx context.Context, modelId
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetProductTemplateListByParamsReq struct {
|
type GetProductTemplateListByParamsReq struct {
|
||||||
ProductIds []int64
|
ProductIds []int64 //必传哦
|
||||||
GroupBy string
|
GroupBy string
|
||||||
OrderBy string
|
OrderBy string
|
||||||
Fields string
|
Fields 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) {
|
||||||
db := t.db.WithContext(ctx).Model(&FsProductTemplateV2{})
|
if len(req.ProductIds) == 0{
|
||||||
if len(req.ProductIds) > 0{
|
return
|
||||||
db = db.Where("`product_id` in (?)",req.ProductIds)
|
|
||||||
}
|
}
|
||||||
|
db := t.db.WithContext(ctx).Model(&FsProductTemplateV2{}).Where("`product_id` in (?)",req.ProductIds)
|
||||||
if req.GroupBy != ""{
|
if req.GroupBy != ""{
|
||||||
db = db.Group(req.GroupBy)
|
db = db.Group(req.GroupBy)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user