JSON encode with relational model

Models : user,product in relational model user->product->id is printing in same view Json also how I get