我在控制器中有以下代码。Claim.number
我可以按除和之外的所有字段进行排序Payer.abbr
。有人知道为什么会这样吗?
$this->paginate = array(
'fields' => array(
'PaymentException.*', 'Procedure.id', 'Procedure.cpt',
'Procedure.expected_amount', 'Procedure.allowed_amount', 'Procedure.difference_amount',
'Claim.id', 'Claim.number', 'Payer.abbr'
),
'limit' => 50,
'joins' => array(
array(
'table' => 'procedures',
'alias' => 'Procedure',
'conditions' => array('Procedure.id = PaymentException.procedure_id')
),
array(
'table' => 'claims',
'alias' => 'Claim',
'conditions' => array('Claim.id = Procedure.claim_id')
),
array(
'table' => 'payers',
'alias' => 'Payer',
'conditions' => array('Payer.id = Procedure.payer_id')
),
array(
'table' => 'groups',
'alias' => 'Groups',
'conditions' => array('Groups.id = Claim.group_id')
),
array(
'table' => 'exception_workflow_logs',
'alias' => 'ExceptionWorkflowLog',
'conditions' => array('ExceptionWorkflowLog.exception_id = PaymentException.id')
)
),
'conditions' => $conditions
);
所有字段都已在视图中完成,例如:
<?php echo $this->Paginator->sort('Claim', 'Claim.number'); ?>
我在 URL 中看到它们,但它从不按Claim.number
or排序Payer.abbr
。我不明白为什么会这样。
在我的条件数组中,我有:
array
0 => string 'Procedure.difference_amount < 0' (length=31)
1 => string 'PaymentException.finalized IS NULL' (length=34)
请注意,即使在正确排序的列上,条件数组也保持不变。