{"action":"created","issue":{"url":"https://api.github.com/repos/75team/thinkjs/issues/293","repository_url":"https://api.github.com/repos/75team/thinkjs","labels_url":"https://api.github.com/repos/75team/thinkjs/issues/293/labels{/name}","comments_url":"https://api.github.com/repos/75team/thinkjs/issues/293/comments","events_url":"https://api.github.com/repos/75team/thinkjs/issues/293/events","html_url":"https://github.com/75team/thinkjs/issues/293","id":140473384,"number":293,"title":"thinkjs 关联查询 relation 的问题","user":{"login":"YoRolling","id":4066805,"avatar_url":"https://avatars.githubusercontent.com/u/4066805?v=3","gravatar_id":"","url":"https://api.github.com/users/YoRolling","html_url":"https://github.com/YoRolling","followers_url":"https://api.github.com/users/YoRolling/followers","following_url":"https://api.github.com/users/YoRolling/following{/other_user}","gists_url":"https://api.github.com/users/YoRolling/gists{/gist_id}","starred_url":"https://api.github.com/users/YoRolling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YoRolling/subscriptions","organizations_url":"https://api.github.com/users/YoRolling/orgs","repos_url":"https://api.github.com/users/YoRolling/repos","events_url":"https://api.github.com/users/YoRolling/events{/privacy}","received_events_url":"https://api.github.com/users/YoRolling/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-13T10:35:49Z","updated_at":"2016-03-23T09:22:28Z","closed_at":null,"body":"## DESC\r\n关联查询Belong to 的时候关联键为undefined\r\n`\r\n\r\n    init() {\r\n        this.super('init', arguments);     \r\n\r\n        this.relation = {  \r\n\r\n            user: {  \r\n\r\n                type: think.model.BELONG_TO,  \r\n\r\n                model: \"user\",  //  关联用户表\r\n\r\n                name: \"user_id\",  \r\n\r\n                key: \"uid\",   // 当前模型外键关联字段是UID\r\n \r\n                fkey: \"id\"   // 用户表对应的是主键ID\r\n\r\n            }  \r\n\r\n        }  \r\n\r\n    }\r\n`\r\n\r\n控制台SQL \r\n\r\n\r\n`    SELECT * FROM tbl_ugames WHERE ( 'hashKey' = 'c9510277708a62' ) 1ms `\r\n\r\n`SELECT * FROM tbl_user WHERE ( 'id' = undefined ) 1ms `\r\n\r\n烦请解答，tks~~ ;-)\r\n## ENV\r\n\r\nPlatform: win10 64\r\n\r\nNode.js Version:4.1.1\r\n\r\nThinkJS Version: 2.1.7\r\n"},"comment":{"url":"https://api.github.com/repos/75team/thinkjs/issues/comments/200264788","html_url":"https://github.com/75team/thinkjs/issues/293#issuecomment-200264788","issue_url":"https://api.github.com/repos/75team/thinkjs/issues/293","id":200264788,"user":{"login":"welefen","id":40935,"avatar_url":"https://avatars.githubusercontent.com/u/40935?v=3","gravatar_id":"","url":"https://api.github.com/users/welefen","html_url":"https://github.com/welefen","followers_url":"https://api.github.com/users/welefen/followers","following_url":"https://api.github.com/users/welefen/following{/other_user}","gists_url":"https://api.github.com/users/welefen/gists{/gist_id}","starred_url":"https://api.github.com/users/welefen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welefen/subscriptions","organizations_url":"https://api.github.com/users/welefen/orgs","repos_url":"https://api.github.com/users/welefen/repos","events_url":"https://api.github.com/users/welefen/events{/privacy}","received_events_url":"https://api.github.com/users/welefen/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T09:22:28Z","updated_at":"2016-03-23T09:22:28Z","body":"https://github.com/75team/thinkjs/commit/d1601cc910f2840821b22effce7c4e1c2d0cd889  已经修复"}}