By default when someone views this page, the controller has no record ID to indicate which details to show -- it's the main landing page after login.
Because of this, I have some conditional logic in my controller to basically determine if the record ID is zero or invalid, in which case the entire models records are queried one by one, the average is calculated and that data is shown.
Otherwise, the valid ID is passed to the model and the details for that specific record are display.
So I ask: Should I refactor this logic into the model as a specialized method or does it make sense in the controller?
The model is used a few times throughout the site, but this additional conditional logic is not needed, whereas the CRUD ops are. This is really the only time these details will likely be calculated, so I currently justify keeping the logic in the controller.
What do you think?