3张表:
PaymentRequests
PaymentPurchaseOrders
PurchaseOrders
目前的关系:
PaymentRequests -> HasMany -> PaymentPurchaseOrders -> BelongsTo ->PurchaseOrders
控制器上的当前代码:
$Get = $this->PaymentRequests->find(
'all', [
'contain'=>['PaymentPurchaseOrder'=>['PurchaseOrder']
]);
问题:
查询太重了。我想在模型中将其关联起来,但我不知道如何。