forked from free-lancers/electricity_bill_calc_service
fix(stat):修正统计部分的关联设计。
This commit is contained in:
@@ -66,10 +66,10 @@ func (_StatisticsService) ParksNewestState(userIds ...string) ([]model.ParkPerio
|
||||
Relation("Park", func(q *bun.SelectQuery) *bun.SelectQuery {
|
||||
return q.Column("id", "name")
|
||||
}).
|
||||
Where("p.enabled = ?", true).
|
||||
Where("r.publidhed = ?", true)
|
||||
Where("park.enabled = ?", true).
|
||||
Where("r.published = ?", true)
|
||||
if len(userIds) > 0 {
|
||||
query = query.Where("p.user_id in (?)", bun.In(userIds))
|
||||
query = query.Where("park.user_id in (?)", bun.In(userIds))
|
||||
}
|
||||
parks := make([]model.ParkPeriodStatistics, 0)
|
||||
groupedParks := make(map[string]model.ParkPeriodStatistics, 0)
|
||||
|
Reference in New Issue
Block a user