fix
This commit is contained in:
@@ -153,3 +153,17 @@ func (t *FsProductTemplateV2Model) GetListByProductAndTemplateTag(ctx context.Co
|
||||
err = db.Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
func (t *FsProductTemplateV2Model) FindAllByProductIdsTemplateTag(ctx context.Context, productIds []int64, templateTag string, sort string, fields ...string) (resp []FsProductTemplateV2, err error) {
|
||||
if len(productIds) == 0 {
|
||||
return
|
||||
}
|
||||
db := t.db.WithContext(ctx).Model(&FsProductTemplateV2{}).Where("`product_id` in (?) and `template_tag` = ? and `is_del` = ? and `status` = ?", productIds, templateTag, 0, 1)
|
||||
if sort != "" {
|
||||
db = db.Order(sort)
|
||||
}
|
||||
if len(fields) != 0 {
|
||||
db = db.Select(fields[0])
|
||||
}
|
||||
err = db.Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user