...
|
...
|
@@ -129,7 +129,7 @@ func (repo *EvaluationTemplateRepository) Find(queryOptions map[string]interface |
|
|
query.Where("id != ?", v)
|
|
|
}
|
|
|
|
|
|
if v, ok := queryOptions["name"]; ok && len(v.(string)) > 0 {
|
|
|
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
|
|
|
query.Where("name LIKE ?", v)
|
|
|
}
|
|
|
|
...
|
...
|
@@ -142,12 +142,15 @@ func (repo *EvaluationTemplateRepository) Find(queryOptions map[string]interface |
|
|
}
|
|
|
|
|
|
if v, ok := queryOptions["createdAt"]; ok {
|
|
|
t := v.(*time.Time)
|
|
|
year, month, day := t.Date()
|
|
|
begin := time.Date(year, month, day, 0, 0, 0, 0, time.Local)
|
|
|
end := time.Date(year, month, day, 23, 59, 59, 0, time.Local)
|
|
|
query.Where("created_at >= ?", begin)
|
|
|
query.Where("created_at <= ?", end)
|
|
|
ts := v.(string)
|
|
|
t, err := time.ParseInLocation("2006-01-02", ts, time.Local)
|
|
|
if err == nil {
|
|
|
year, month, day := t.Date()
|
|
|
begin := time.Date(year, month, day, 0, 0, 0, 0, time.Local)
|
|
|
end := time.Date(year, month, day, 23, 59, 59, 0, time.Local)
|
|
|
query.Where("created_at >= ?", begin)
|
|
|
query.Where("created_at <= ?", end)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if v, ok := queryOptions["limit"].(int64); ok {
|
...
|
...
|
@@ -183,7 +186,7 @@ func (repo *EvaluationTemplateRepository) Count(queryOptions map[string]interfac |
|
|
query.Where("id != ?", v)
|
|
|
}
|
|
|
|
|
|
if v, ok := queryOptions["name"]; ok {
|
|
|
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
|
|
|
query.Where("name = ?", v)
|
|
|
}
|
|
|
|
...
|
...
|
|