Closed Hashiyama89 closed 5 years ago
This is a bug and fixed it on cf25af9.
However, when joining table, all those column name should be with table name as prefix.
$this->select([
'[>]photos' => ['id' => 'photo_id']
], [
'books.id' => [
'books.id [Int]',
'photos.name',
'photos.url'
]
], [
"books.id" => $ids
]);
Describe the bug When you use a join query, and want to map one field which exists in both tables, it doesn't work.
Information
Detail Code
If I do this, they cant find the index mappin 'books.id'
$result = $this->select( ['[>]photos' => ['id' => 'photo_id']] , [ 'books.id' => [ 'books.id [Int]', 'name', 'url' ]], ["books.id" => $ids]);
In this case, the field ID exists in photos and books, so the query crash.
$result = $this->select( ['[>]photos' => ['id' => 'photo_id']] , [ 'id' => [ 'books.id [Int]', 'name', 'url' ]], ["books.id" => $ids]);