【发布时间】:2020-07-02 12:30:38
【问题描述】:
我有一个场景,我必须将同一个模型与 hasMany 相关联。
Children 在PatientPaymentTransaction 模型中具有多关系:
public $hasMany = [
'Children' => [
'className' => 'PatientPaymentTransaction',
'foreignKey' => false,
'dependent' => true,
// 'conditions' => ['Children.reference_id' => 'PatientPaymentTransaction.transaction_id' ],
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => 'SELECT *,children.reference_id as patient_payment_transaction_id FROM patient_payment_transactions children WHERE children.reference_id = {$__cakeID__$}',
'counterQuery' => ''
]
];
回应
在children中找到但未附加数据。
我做错了什么?
【问题讨论】:
标签: php cakephp cakephp-2.3