{"action":"closed","issue":{"url":"https://api.github.com/repos/studio107/Mindy_Orm/issues/129","repository_url":"https://api.github.com/repos/studio107/Mindy_Orm","labels_url":"https://api.github.com/repos/studio107/Mindy_Orm/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/studio107/Mindy_Orm/issues/129/comments","events_url":"https://api.github.com/repos/studio107/Mindy_Orm/issues/129/events","html_url":"https://github.com/studio107/Mindy_Orm/issues/129","id":137495023,"number":129,"title":"HasManyField - дупликаты в выборке","user":{"login":"qantus","id":3940487,"avatar_url":"https://avatars.githubusercontent.com/u/3940487?v=3","gravatar_id":"","url":"https://api.github.com/users/qantus","html_url":"https://github.com/qantus","followers_url":"https://api.github.com/users/qantus/followers","following_url":"https://api.github.com/users/qantus/following{/other_user}","gists_url":"https://api.github.com/users/qantus/gists{/gist_id}","starred_url":"https://api.github.com/users/qantus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qantus/subscriptions","organizations_url":"https://api.github.com/users/qantus/orgs","repos_url":"https://api.github.com/users/qantus/repos","events_url":"https://api.github.com/users/qantus/events{/privacy}","received_events_url":"https://api.github.com/users/qantus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-01T07:21:47Z","updated_at":"2016-03-01T12:55:07Z","closed_at":"2016-03-01T12:55:07Z","body":"Выполнение кода:\r\n```php\r\nCup::objects()->filter(['designs__name' => 'Dragon', 'colors__name' => 'red'])->all()\r\n```\r\n\r\nгенерирует вот такой sql;\r\n\r\n```sql\r\nSELECT `tests_cup_1`.*, `tests_design_2`.`cup_id`, `tests_color_3`.`cup_id` \r\nFROM `tests_cup` `tests_cup_1` \r\nLEFT OUTER JOIN `tests_design` `tests_design_2` ON `tests_cup_1`.`id` = `tests_design_2`.`cup_id` \r\nLEFT OUTER JOIN `tests_color` `tests_color_3` ON `tests_cup_1`.`id` = `tests_color_3`.`cup_id` WHERE (`tests_design_2`.`name`='Dragon') AND (`tests_color_3`.`name`='red') \r\nGROUP BY `tests_cup_1`.`id`, `tests_cup_1`.`id`\r\n```\r\n\r\nСоответственно, СУБД ругается на то что в выборке присутствует 2 раза одно и то же поле \"cup_id\". Нужны ли эти поля в выборке вообще, если без них все тесты проходят (и sqlite и mysql и pgsql)? Пришлю pull-request - посмотри плз."}}