How to convert SQL to cakephp 2.8 query to query from controller

70 Views Asked by At
SELECT * 
FROM `ads_partner_wises` 
WHERE app_code = 'XuS5II' 
AND acc_id = 89 
OR app_code = 0 
AND acc_id = 0

Cakephp 2.8 in not working query.

1

There are 1 best solutions below

0
chunara vivek On

Finally my issues fixed cakephp 2.8 now,

$test_data_qry = $this->AdsPartnerWises->find('all', array('conditions' => array(
            'AND' => array(
                'OR' => array(
                    'OR' => array('AdsPartnerWises.app_code' => 0, 'AdsPartnerWises.acc_id' => 0),
                    'AdsPartnerWises.app_code' => 'XuS5II', 'AdsPartnerWises.acc_id' => 89),))));

this using after working now thanks.