Anatoliy
Well-known member
I'm building an add-on that shows me a list of users who are not active for a week, but were active within a previous week. And their xf_user_options.
So I built a controller with 2 actions (index & details), and 2 templates. On index page I see a list of users, sorted by message_count, desc. When I click a user I get to the details page that shows details from xf_user_option : receive_admin_email, creation_watch_state, interaction_watch_state, email_on_conversation.
But it would be more useful if all that data would be in a list on the index page without a need to click and go for details to another page. I understand that it probably could be done with ->(with), but I didn't use it before and I'm not sure that I understood correctly how it works.
I tried finder xf:user ->with('xf:UserOption') but it looks like it has no relation. I thought about finder for UserOption with User, but then I don't know how to sort results by message_count, desc.
Please push me to the right direction.
So I built a controller with 2 actions (index & details), and 2 templates. On index page I see a list of users, sorted by message_count, desc. When I click a user I get to the details page that shows details from xf_user_option : receive_admin_email, creation_watch_state, interaction_watch_state, email_on_conversation.
But it would be more useful if all that data would be in a list on the index page without a need to click and go for details to another page. I understand that it probably could be done with ->(with), but I didn't use it before and I'm not sure that I understood correctly how it works.
I tried finder xf:user ->with('xf:UserOption') but it looks like it has no relation. I thought about finder for UserOption with User, but then I don't know how to sort results by message_count, desc.
Please push me to the right direction.