Cakephp 3 Custom Pagination

Working in CakePHP 3.9.
I doing a page having multiple joins in a single query making it a complex query.
I wanted to have pagination for that page.
I tried using paginate and paginateCount function in a model which was working fine till CakePHP 2x.
But it is giving only the main table results and not including the joins.
Anyone who have succeeded facing this issue please help me.