Reduces the number of SQL queries used on group_orders/index and group_orders/archive, but adds extra complexity to the code