This commit is contained in:
Daniel 2025-08-21 10:55:31 +08:00
parent 6803c6483e
commit 599cf0cf46
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 13 additions and 9 deletions

View file

@ -29,8 +29,8 @@ type ViewFilter struct {
Column string `json:"column"` // 列字段ID Column string `json:"column"` // 列字段ID
Operator FilterOperator `json:"operator"` // 过滤操作符 Operator FilterOperator `json:"operator"` // 过滤操作符
Value *Value `json:"value"` // 过滤值 Value *Value `json:"value"` // 过滤值
RelativeDate *RelativeDate `json:"relativeDate"` // 相对时间 RelativeDate *RelativeDate `json:"relativeDate,omitempty"` // 相对时间
RelativeDate2 *RelativeDate `json:"relativeDate2"` // 第二个相对时间,用于某些操作符,比如 FilterOperatorIsBetween RelativeDate2 *RelativeDate `json:"relativeDate2,omitempty"` // 第二个相对时间,用于某些操作符,比如 FilterOperatorIsBetween
} }
type RelativeDateUnit int type RelativeDateUnit int
@ -360,6 +360,10 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa
} }
case KeyTypeSelect, KeyTypeMSelect: case KeyTypeSelect, KeyTypeMSelect:
if nil != value.MSelect { if nil != value.MSelect {
if 1 > len(other.MSelect) {
return true
}
switch operator { switch operator {
case FilterOperatorIsEqual, FilterOperatorContains: case FilterOperatorIsEqual, FilterOperatorContains:
contains := false contains := false

View file

@ -374,11 +374,11 @@ func (value *Value) GetValByType(typ KeyType) (ret interface{}) {
} }
type ValueBlock struct { type ValueBlock struct {
ID string `json:"id"` // 绑定的块 ID非绑定块时为空 ID string `json:"id,omitempty"` // 绑定的块 ID非绑定块时为空
Icon string `json:"icon"` Icon string `json:"icon,omitempty"`
Content string `json:"content"` Content string `json:"content"`
Created int64 `json:"created"` Created int64 `json:"created,omitempty"`
Updated int64 `json:"updated"` Updated int64 `json:"updated,omitempty"`
} }
type ValueText struct { type ValueText struct {