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

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

View file

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