This commit is contained in:
@@ -109,7 +109,13 @@ func (s *DeviceStore) List(ctx context.Context, opts *store.QueryOptions, filter
|
||||
if status, ok := filters["status"].(int); ok && status > 0 {
|
||||
query = query.Where("status = ?", status)
|
||||
}
|
||||
if shopID, ok := filters["shop_id"].(*uint); ok {
|
||||
if shopIDs, ok := filters["shop_ids"].([]uint); ok {
|
||||
if len(shopIDs) == 0 {
|
||||
query = query.Where("1 = 0")
|
||||
} else {
|
||||
query = query.Where("shop_id IN ?", shopIDs)
|
||||
}
|
||||
} else if shopID, ok := filters["shop_id"].(*uint); ok {
|
||||
if shopID == nil {
|
||||
query = query.Where("shop_id IS NULL")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user