Skip to content

Commit

Permalink
🐛 Database filtering for specific dates not working Fix #10518
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Mar 7, 2024
1 parent acb894a commit bdaf3f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kernel/av/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,12 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, rowID st
return false
}

if nil != value.Relation && KeyTypeRelation == value.Type && nil != filter && nil != filter.Value && KeyTypeRelation == filter.Value.Type &&
nil != filter.Value.Relation && 0 < len(filter.Value.Relation.Contents) {
if nil != value.Relation && KeyTypeRelation == value.Type && 0 < len(value.Relation.Contents) && nil != filter && nil != filter.Value && KeyTypeRelation == filter.Value.Type &&
nil != filter.Value.Relation && 0 < len(filter.Value.Relation.BlockIDs) && 0 < len(filter.Value.Relation.BlockIDs) {
// 单独处理关联类型的比较
return value.filter(filter.Value.Relation.Contents[0], filter.RelativeDate, filter.RelativeDate2, filter.Operator)
relationValue := value.Relation.Contents[0]
filterValue := &Value{Type: KeyTypeBlock, Block: &ValueBlock{Content: filter.Value.Relation.BlockIDs[0]}}
return relationValue.filter(filterValue, filter.RelativeDate, filter.RelativeDate2, filter.Operator)
}

return value.filter(filter.Value, filter.RelativeDate, filter.RelativeDate2, filter.Operator)
Expand Down

0 comments on commit bdaf3f4

Please sign in to comment.