|
|
|
@ -93,13 +93,13 @@ func (opts *FindReplacementLessonsOptions) ToCond() builder.Cond { |
|
|
|
|
cond := builder.NewCond() |
|
|
|
|
|
|
|
|
|
if !opts.Date.IsZero() { |
|
|
|
|
cond = cond.And(builder.Eq{"date_unix": opts.Date}) |
|
|
|
|
cond = cond.And(builder.Eq{"date_unix": opts.Date.Unix()}) |
|
|
|
|
} else { |
|
|
|
|
if !opts.StartDate.IsZero() { |
|
|
|
|
cond = cond.And(builder.Gte{"date_unix": opts.StartDate}) |
|
|
|
|
cond = cond.And(builder.Gte{"date_unix": opts.StartDate.Unix()}) |
|
|
|
|
} |
|
|
|
|
if !opts.EndDate.IsZero() { |
|
|
|
|
cond = cond.And(builder.Lte{"date_unix": opts.EndDate}) |
|
|
|
|
cond = cond.And(builder.Lte{"date_unix": opts.EndDate.Unix()}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return cond |
|
|
|
|