fix: issues
This commit is contained in:
@@ -119,12 +119,13 @@ func (svc *Service) List(ctx context.Context, tenantId, userId int64, filter *Li
|
||||
}
|
||||
|
||||
if filter.Bought != nil && *filter.Bought {
|
||||
if len(boughtIDs) > 0 {
|
||||
cond = cond.
|
||||
AND(tbl.ID.IN(lo.Map(boughtIDs, func(item int64, _ int) Expression {
|
||||
return Int(item)
|
||||
})...))
|
||||
if len(boughtIDs) == 0 {
|
||||
return []*ListItem{}, nil
|
||||
}
|
||||
cond = cond.
|
||||
AND(tbl.ID.IN(lo.Map(boughtIDs, func(item int64, _ int) Expression {
|
||||
return Int(item)
|
||||
})...))
|
||||
} else {
|
||||
cond = cond.AND(tbl.Publish.EQ(Bool(true)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user