Group chore detail query by chore ID and last completed date
This commit is contained in:
parent
45e18c8edd
commit
36f4717454
|
@ -243,7 +243,7 @@ func (r *ChoreRepository) GetChoreDetailByID(c context.Context, choreID int, cir
|
||||||
)
|
)
|
||||||
) AS recent_history ON chores.id = recent_history.chore_id`).
|
) AS recent_history ON chores.id = recent_history.chore_id`).
|
||||||
Where("chores.id = ? and chores.circle_id = ?", choreID, circleID).
|
Where("chores.id = ? and chores.circle_id = ?", choreID, circleID).
|
||||||
Group("chores.id").
|
Group("chores.id, recent_history.last_completed_date").
|
||||||
First(&choreDetail).Error; err != nil {
|
First(&choreDetail).Error; err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue