I have 3 tables (companies, services, params). The relations between the tables is as follows: a company has many services, a service has many params, a service belongs to one company. I'm trying to join the companies with the services and the services with the params and return it as a json.I have 3 tables (companies, services, params).