|
|
|
|
@ -165,13 +165,16 @@ func (p Provider) saveTimes(ctx context.Context, locationID string, times []pray
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p Provider) loadTimes(ctx context.Context, locationID string) ([]prayer.Times, error) {
|
|
|
|
|
now := p.clockFunc()
|
|
|
|
|
today := now.Truncate(time.Hour * 24)
|
|
|
|
|
|
|
|
|
|
q := p.db.
|
|
|
|
|
From(goqu.T("prayer_times").As("pt")).
|
|
|
|
|
Join(goqu.T("providers").As("p"), goqu.On(goqu.I("p.id").Eq(goqu.I("pt.provider_id")))).
|
|
|
|
|
Where(
|
|
|
|
|
goqu.I("p.name").Eq(p.provider.Name()),
|
|
|
|
|
goqu.I("pt.location_id").Eq(locationID),
|
|
|
|
|
goqu.I("pt.date").Gte(p.clockFunc()),
|
|
|
|
|
goqu.I("pt.date").Gte(today),
|
|
|
|
|
).
|
|
|
|
|
Limit(100)
|
|
|
|
|
|
|
|
|
|
|