1
$table = TableRegistry::get('Leads');
$query = $table->find('all')->leftJoinWith('LeadStatus')->contain(['Users', 'LeadStatus' =>
function ($q)
{
return $q->contain(['LeadBuckets', 'LeadBucketSubStatus'])->where(['LeadStatus.is_active' => 1]);
}
])->where(['Leads.sub_agent_id' => $subAgentId]);
这是我的查询,我现在用左从表lead_status
加入了表leads
如何用户加入。现在,我还想在同一个查询中使用第三个表assigned_leads
的左连接。两个左CakePHP中3.X
我试过联合表leads
和lead_status
与assigned_leads
。我正在使用cakephp 3.x我怎样才能做到这一点?