作者 yangfu

fix: no query result when filed type is Date

@@ -146,6 +146,8 @@ func (c Condition) SetWhere(params QueryOptions, q *gorm.DB) { @@ -146,6 +146,8 @@ func (c Condition) SetWhere(params QueryOptions, q *gorm.DB) {
146 } else { 146 } else {
147 q.Where(fmt.Sprintf("%v in %v", c.CastType(c.Field.SQLName, domain.DECIMALV2.ToString()), c.InArgs(c.In))) 147 q.Where(fmt.Sprintf("%v in %v", c.CastType(c.Field.SQLName, domain.DECIMALV2.ToString()), c.InArgs(c.In)))
148 } 148 }
  149 + } else if c.Field.SQLType == domain.Date.ToString() {
  150 + q.Where(fmt.Sprintf("%v in %v", c.CastType(c.FormatIfNull(params, c.Field), "datetime"), c.InArgs(c.In)))
149 } else { 151 } else {
150 q.Where(fmt.Sprintf("%v in %v", c.CastType(c.FormatIfNull(params, c.Field), "string"), c.InArgs(c.In))) 152 q.Where(fmt.Sprintf("%v in %v", c.CastType(c.FormatIfNull(params, c.Field), "string"), c.InArgs(c.In)))
151 } 153 }