fix: no query result when filed type is Date
正在显示
1 个修改的文件
包含
2 行增加
和
0 行删除
| @@ -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 | } |
-
请 注册 或 登录 后发表评论