简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM