fix
This commit is contained in:
@@ -4,11 +4,14 @@ import (
|
||||
"context"
|
||||
)
|
||||
|
||||
func (t *FsProductTemplateV2Model) FindAllByProductIds(ctx context.Context, productIds []int64, fields ...string) (resp []FsProductTemplateV2, err error) {
|
||||
func (t *FsProductTemplateV2Model) FindAllByProductIds(ctx context.Context, productIds []int64, 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 `is_del` = ? and `status` = ?", productIds, 0, 1)
|
||||
if sort != "" {
|
||||
db = db.Order(sort)
|
||||
}
|
||||
if len(fields) != 0 {
|
||||
db = db.Select(fields[0])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user