This commit is contained in:
aozhiwei 2024-07-04 03:05:27 +08:00
parent 244bc7e390
commit 0bce451b13

View File

@ -278,20 +278,25 @@ SELECT * FROM t_order A WHERE idx > %d AND net_id = %d
}
if priceMin != "" && priceMax != "" {
q5.AppendSlice(&subFilters, f5.GetDbFilter().Custom(
fmt.Sprintf(`LENGTH(price) >= LENGTH('%s') AND price >= '%s' AND
LENGTH(price) <= LENGTH('%s') AND price <= '%s'`,
fmt.Sprintf(`
((LENGTH(price) > LENGTH('%s') OR (LENGTH(price) = LENGTH('%s') AND price >= '%s'))) AND
((LENGTH(price) < LENGTH('%s') OR (LENGTH(price) = LENGTH('%s') AND price <= '%s')))`,
priceMin,
priceMin,
priceMin,
priceMax,
priceMax,
priceMax)).And())
} else if priceMin != "" {
q5.AppendSlice(&subFilters, f5.GetDbFilter().Custom(
fmt.Sprintf(`LENGTH(price) >= LENGTH('%s') AND price >= '%s'`,
fmt.Sprintf(`(LENGTH(price) > LENGTH('%s') OR (LENGTH(price) = LENGTH('%s') AND price >= '%s'))`,
priceMin,
priceMin,
priceMin)).And())
} else if priceMax != "" {
q5.AppendSlice(&subFilters, f5.GetDbFilter().Custom(
fmt.Sprintf(`LENGTH(price) <= LENGTH('%s') AND price <= '%s'`,
fmt.Sprintf(`(LENGTH(price) < LENGTH('%s') OR (LENGTH(price) = LENGTH('%s') AND price <= '%s'))`,
priceMax,
priceMax,
priceMax)).And())
}