컨트롤러에 다음 코드가 있습니다. Claim.number
및 Payer.abbr
을 제외한 모든 필드로 정렬 할 수 있습니다. 왜 그런지 알 겠어? 나는 URL에서 볼일부 열의 cakephp 페이지 매김 만 정렬
<?php echo $this->Paginator->sort('Claim', 'Claim.number'); ?>
하지만 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
);
필드의 모든
처럼 뷰에서 수행되었다. 왜 그렇게 될지 모르겠다. 내 조건 배열에서나는이 : 조건 배열이 제대로 정렬에도 열을 동일하게 유지
array
0 => string 'Procedure.difference_amount < 0' (length=31)
1 => string 'PaymentException.finalized IS NULL' (length=34)
하는 것으로.
생성 된 SQL 가져오고 올바른지 확인하십시오. phpMyAdmin 또는 다른 도구에서 해당 쿼리를 실행하여 작동하는지 확인하십시오. – tigrang
SQL 출력을 보면 올바르지 않습니다. 'Claim.number'로 정렬하려고하는데 출력에'ORDER BY'가 없습니다. – tubaguy50035
$ conditions 배열에는 무엇이 있습니까? –