Closed tipleavalentin closed 3 years ago
Note: if I don't select the ID column from the second table then the first table ID is correct.
It will be conflicted if you are joining two table with same alias name.
So change the joined table column alias as possible
"compartments.id (id) [Int]",
"compartment": [
"compartment_units.id (unit_id) [Int]",
]
It is an idea may make this possible for that, but it need more complex process for handling fetched data and slow down the speed. I may try for it.
Describe the bug I'm trying to join two tables and get the content in an array (mapped data) but the first table ID is wrong.
Information
Expected output What I should get as result is this: { "id": 71, "compartment": { "id": 15 } }
But I get a wrong result which is this: { "id": 15, "compartment": { "id": 15 } }
So basically the id of the compartment is replaced by the id of the compartment_units record.