|
@@ -250,9 +250,9 @@ func (e *Entity) prepareConditions(ctx *http.Context, query *Query, schemas []*S
|
|
|
switch schema.Format {
|
|
|
case "string", "text", "textarea":
|
|
|
if schema.getProperties().Match == MatchExactly {
|
|
|
- query.AndFilterWhere(NewQueryCondition(schema.Column, formValue))
|
|
|
+ query.AndFilterWhere(NewCond(schema.Column, formValue))
|
|
|
} else {
|
|
|
- query.AndFilterWhere(NewQueryConditionWithOperator("LIKE", schema.Column, formValue))
|
|
|
+ query.AndFilterWhere(NewCond(schema.Column, formValue).WithExpr("LIKE"))
|
|
|
}
|
|
|
case "date", "time", "datetime":
|
|
|
var sep string
|
|
@@ -264,23 +264,23 @@ func (e *Entity) prepareConditions(ctx *http.Context, query *Query, schemas []*S
|
|
|
}
|
|
|
if ss := strings.Split(formValue, sep); len(ss) == 2 {
|
|
|
query.AndFilterWhere(
|
|
|
- NewQueryConditionWithOperator(">=", schema.Column, strings.TrimSpace(ss[0])),
|
|
|
- NewQueryConditionWithOperator("<=", schema.Column, strings.TrimSpace(ss[1])),
|
|
|
+ NewCond(schema.Column, strings.TrimSpace(ss[0])).WithExpr(">="),
|
|
|
+ NewCond(schema.Column, strings.TrimSpace(ss[1])).WithExpr("<="),
|
|
|
)
|
|
|
} else {
|
|
|
- query.AndFilterWhere(NewQueryCondition(schema.Column, formValue))
|
|
|
+ query.AndFilterWhere(NewCond(schema.Column, formValue))
|
|
|
}
|
|
|
case "duration", "number", "integer", "decimal":
|
|
|
- query.AndFilterWhere(NewQueryCondition(schema.Column, formValue))
|
|
|
+ query.AndFilterWhere(NewCond(schema.Column, formValue))
|
|
|
default:
|
|
|
if schema.Type == "string" {
|
|
|
if schema.getProperties().Match == MatchExactly {
|
|
|
- query.AndFilterWhere(NewQueryCondition(schema.Column, formValue))
|
|
|
+ query.AndFilterWhere(NewCond(schema.Column, formValue))
|
|
|
} else {
|
|
|
- query.AndFilterWhere(NewQueryConditionWithOperator("LIKE", schema.Column, formValue))
|
|
|
+ query.AndFilterWhere(NewCond(schema.Column, formValue).WithExpr("LIKE"))
|
|
|
}
|
|
|
} else {
|
|
|
- query.AndFilterWhere(NewQueryCondition(schema.Column, formValue))
|
|
|
+ query.AndFilterWhere(NewCond(schema.Column, formValue))
|
|
|
}
|
|
|
}
|
|
|
}
|