Code is not working condition is working but order sorting is not working
Please help me what is the issue
$this->Offer->find(
'all',
array(
'conditions' => array(
'OR' => array(
array('Offer.branch_id' => 1),
array('Offer.branch_id' => $branch['Branch']['id'])
)
)
),
array('order' => array('Offer.order_no' => 'DESC'))
);
Try this code :->
$this->Offer->find(
'all',
array(
'conditions' => array(
'OR' => array(
array('Offer.branch_id' => 1),
array('Offer.branch_id' => $branch['Branch']['id'])
)
),
'order' => array('Offer.order_no' => 'DESC')
)
);
$this->Offer->find('all', array(
'conditions' => array(
'OR' => array(
'Offer.branch_id' => 1,
'Offer.branch_id' => $branch['Branch']['id']
)
),
'order' => array('Offer.order_no DESC')
));
DESC = descending, is sort order_no from last ASC = ascending, sort from first