Redefine the model association, fixed the many to many total count bug and list view paging bug.