cakephp中的联接表?

cakephp中的联接表?,cakephp,Cakephp,我在使用cakephp3时遇到问题,我有3个表用户(用户id、用户名、密码、电子邮件)、帖子(帖子id、用户id、内容帖子)和评论(评论id、用户id、帖子id)如何在cakephp3中使用查询加入3个表谢谢。检查示例查询 $GroupAccountIds = $this->ClientForm->find( 'list', [ 'joins' => [ [ 'table'=>'group_accounts',

我在使用cakephp3时遇到问题,我有3个表用户(用户id、用户名、密码、电子邮件)、帖子(帖子id、用户id、内容帖子)和评论(评论id、用户id、帖子id)如何在cakephp3中使用查询加入3个表谢谢。

检查示例查询

$GroupAccountIds = $this->ClientForm->find(
'list',
[
    'joins' => [
        [
            'table'=>'group_accounts',
            'alias' => 'GroupAccount',
            'type' => 'INNER',
            'conditions' => [
                'ClientForm.created_group_account_id = GroupAccount.group_account_id',
                'ClientForm.deleted IS NULL'
            ]
        ],
    ],
    'conditions' => [
        'GroupAccount.group_account_category_id' => $smsfCategoryId,
        'GroupAccount.deleted' => null,
    ],
    'fields' => [
        'ClientForm.created_group_account_id',
        'ClientForm.created_group_account_id',
    ],
]

))

使用MySQL查询来连接表。哦,我使用cakePHP,这不喜欢MySQL:)你在哪里有用户的详细信息?你能提供你想要的数据库结构和结果吗?试着阅读文档:。